File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ export const createCallbackEndpoint = (
4646
4747 if ( pluginOptions . getToken ) {
4848 access_token = pluginOptions . getToken ( code ) ;
49-
50- if ( typeof access_token !== "string" )
51- throw new Error ( `No access token: ${ access_token } ` ) ;
5249 } else {
5350 const tokenResponse = await fetch ( pluginOptions . tokenEndpoint , {
5451 method : "POST" ,
@@ -67,11 +64,11 @@ export const createCallbackEndpoint = (
6764 const tokenData = await tokenResponse . json ( ) ;
6865
6966 access_token = tokenData ?. access_token ;
70-
71- if ( typeof access_token !== "string" )
72- throw new Error ( `No access token: ${ JSON . stringify ( tokenData ) } ` ) ;
7367 }
7468
69+ if ( typeof access_token !== "string" )
70+ throw new Error ( `No access token: ${ access_token } ` ) ;
71+
7572 // /////////////////////////////////////
7673 // get user info
7774 // /////////////////////////////////////
You can’t perform that action at this time.
0 commit comments