@@ -24,30 +24,30 @@ export const codeValidator = (request, response, next) => {
2424 ] ) {
2525 if ( ! Object . keys ( parameters ) . includes ( parameter ) ) {
2626 throw IndiekitError . badRequest (
27- response . __ ( "BadRequestError.missingParameter" , parameter )
27+ response . locals . __ ( "BadRequestError.missingParameter" , parameter )
2828 ) ;
2929 }
3030 }
3131
3232 // `grant_type` must equal `authorization_code`
3333 if ( grant_type !== "authorization_code" ) {
3434 throw IndiekitError . badRequest (
35- response . __ ( "BadRequestError.invalidValue" , "grant_type" )
35+ response . locals . __ ( "BadRequestError.invalidValue" , "grant_type" )
3636 ) ;
3737 }
3838
3939 // Validate `client_id` against that provided in authorization request
4040 if ( getCanonicalUrl ( client_id ) !== client . url ) {
4141 throw IndiekitError . unauthorized (
42- response . __ ( "BadRequestError.invalidValue" , "client_id" )
42+ response . locals . __ ( "BadRequestError.invalidValue" , "client_id" )
4343 ) ;
4444 }
4545
4646 // Validate `redirect_uri`
4747 const validRedirect = validateRedirect ( redirect_uri , client_id ) ;
4848 if ( ! validRedirect ) {
4949 throw IndiekitError . badRequest (
50- response . __ ( "BadRequestError.invalidValue" , "redirect_uri" )
50+ response . locals . __ ( "BadRequestError.invalidValue" , "redirect_uri" )
5151 ) ;
5252 }
5353
@@ -56,7 +56,7 @@ export const codeValidator = (request, response, next) => {
5656 request . verifiedToken = verifyToken ( code ) ;
5757 } catch {
5858 throw IndiekitError . unauthorized (
59- response . __ ( "UnauthorizedError.invalidToken" )
59+ response . locals . __ ( "UnauthorizedError.invalidToken" )
6060 ) ;
6161 }
6262
@@ -66,7 +66,7 @@ export const codeValidator = (request, response, next) => {
6666 const verifiedCode = verifyCode ( code_verifier , code_challenge ) ;
6767 if ( ! verifiedCode ) {
6868 throw IndiekitError . unauthorized (
69- response . __ ( "BadRequestError.invalidValue" , "code_verifier" )
69+ response . locals . __ ( "BadRequestError.invalidValue" , "code_verifier" )
7070 ) ;
7171 }
7272 }
0 commit comments