Skip to content

Commit 0ca24b2

Browse files
authored
Merge pull request #1366 from OpenBeta/mobile-auth
update scopes for mobile endpoints
2 parents 909d334 + aa32e4e commit 0ca24b2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/app/api/mobile/login/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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
})

src/app/api/mobile/refreshToken/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)