File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 33< head > </ head >
44< body >
55< script >
6- if ( new URLSearchParams ( location . search ) . has ( "code" ) ) {
6+ var params = new URLSearchParams ( location . search ) ;
7+ if ( params . has ( "code" ) || params . has ( "error" ) ) {
78 new BroadcastChannel ( "osm-api-auth-complete" ) . postMessage ( location . href ) ;
89 window . close ( ) ;
910 }
Original file line number Diff line number Diff line change @@ -253,6 +253,11 @@ export function osmAuth(o) {
253253 error . status = 'invalid-state' ;
254254 callback ( error ) ;
255255 return ;
256+ } else if ( params . error !== undefined ) {
257+ var err = new Error ( params . error_description . replace ( / \+ / g, ' ' ) ) ;
258+ err . status = params . error ;
259+ callback ( err ) ;
260+ return ;
256261 }
257262 _getAccessToken ( params . code , pkce . code_verifier , accessTokenDone ) ;
258263 bc . close ( ) ;
You can’t perform that action at this time.
0 commit comments