File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ async function postHandler (request: NextRequest): Promise<NextResponse> {
1818 console . error ( 'Empty username/password!' )
1919 throw new Error ( 'Invalid payload' )
2020 }
21- } catch ( error ) {
21+ } catch ( err ) {
22+ console . error ( 'POST /login error:' , err )
2223 return NextResponse . json ( { error : 'Unexpected error' } , { status : 400 } )
2324 }
2425
@@ -27,7 +28,7 @@ async function postHandler (request: NextRequest): Promise<NextResponse> {
2728 response = await auth0Client . oauth . passwordGrant ( {
2829 username,
2930 password,
30- scope : 'openid profile email offline_access ' ,
31+ scope : 'offline_access access_token_authz openid email profile read:current_user create:current_user_metadata update:current_user_metadata read:stats update:area_attrs ' ,
3132 audience : 'https://api.openbeta.io' ,
3233 realm : 'Username-Password-Authentication'
3334 } )
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ async function postHandler (request: NextRequest): Promise<any> {
2828 try {
2929 response = await auth0Client . oauth . refreshTokenGrant ( {
3030 refresh_token : refreshToken ,
31+ scope : 'offline_access access_token_authz openid email profile read:current_user create:current_user_metadata update:current_user_metadata read:stats update:area_attrs' ,
3132 audience : 'https://api.openbeta.io'
3233 } )
3334
You can’t perform that action at this time.
0 commit comments