File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import { UnaryHandler } from '@matrixai/rpc';
1212import Token from '../../tokens/Token.js' ;
1313import * as clientErrors from '../errors.js' ;
1414import * as nodesUtils from '../../nodes/utils.js' ;
15- import * as tokensUtils from '../../tokens/utils.js' ;
1615
1716class AuthSignToken extends UnaryHandler <
1817 {
@@ -28,17 +27,14 @@ class AuthSignToken extends UnaryHandler<
2827
2928 // Get and verify incoming node
3029 const inputToken = { payload : input . payload , signatures : input . signatures } ;
31- const incomingToken = Token . fromEncoded < TokenIdentityRequest > ( inputToken ) ;
32- const inputPayload = tokensUtils . parseTokenPayload < IdentityRequestData > (
33- inputToken . payload ,
34- ) ;
35- if ( ! ( 'publicKey' in inputPayload ) ) {
30+ const incomingToken = Token . fromEncoded < IdentityRequestData > ( inputToken ) ;
31+ if ( ! ( 'publicKey' in incomingToken . payload ) ) {
3632 throw new clientErrors . ErrorAuthenticationInvalidToken (
3733 'Input token does not contain public key' ,
3834 ) ;
3935 }
4036 const incomingPublicKey = Buffer . from (
41- inputPayload . publicKey ,
37+ incomingToken . payload . publicKey ,
4238 'base64url' ,
4339 ) as PublicKey ;
4440 if ( ! incomingToken . verifyWithPublicKey ( incomingPublicKey ) ) {
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ type TokenMessage = {
111111// Return URL must be present on the token, otherwise token contents is decided
112112// by the client.
113113type IdentityRequestData = TokenPayload & {
114- returnUrl : string ;
114+ returnURL : string ;
115115 publicKey : string ;
116116} ;
117117
You can’t perform that action at this time.
0 commit comments