File tree 1 file changed +3
-6
lines changed 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ export const createCallbackEndpoint = (
46
46
47
47
if ( pluginOptions . getToken ) {
48
48
access_token = pluginOptions . getToken ( code ) ;
49
-
50
- if ( typeof access_token !== "string" )
51
- throw new Error ( `No access token: ${ access_token } ` ) ;
52
49
} else {
53
50
const tokenResponse = await fetch ( pluginOptions . tokenEndpoint , {
54
51
method : "POST" ,
@@ -67,11 +64,11 @@ export const createCallbackEndpoint = (
67
64
const tokenData = await tokenResponse . json ( ) ;
68
65
69
66
access_token = tokenData ?. access_token ;
70
-
71
- if ( typeof access_token !== "string" )
72
- throw new Error ( `No access token: ${ JSON . stringify ( tokenData ) } ` ) ;
73
67
}
74
68
69
+ if ( typeof access_token !== "string" )
70
+ throw new Error ( `No access token: ${ access_token } ` ) ;
71
+
75
72
// /////////////////////////////////////
76
73
// get user info
77
74
// /////////////////////////////////////
You can’t perform that action at this time.
0 commit comments