Skip to content

Commit 11d198c

Browse files
authored
fix: use separate Native app client_id for mobile auth (#1441)
1 parent 988191f commit 11d198c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/Config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface AUTH_CONFIG_SERVER_TYPE {
1212
issuer: string
1313
clientId: string
1414
clientSecret: string
15+
mobileClientId: string
1516
mgmtClientId: string
1617
mgmtClientSecret: string
1718
mgmtClientAudience: string
@@ -25,6 +26,7 @@ if (typeof window === 'undefined') {
2526
issuer: checkAndPrintWarning('AUTH0_DOMAIN', process.env.AUTH0_DOMAIN),
2627
clientId: checkAndPrintWarning('AUTH0_CLIENT_ID', process.env.AUTH0_CLIENT_ID),
2728
clientSecret: checkAndPrintWarning('AUTH0_CLIENT_SECRET', process.env.AUTH0_CLIENT_SECRET),
29+
mobileClientId: checkAndPrintWarning('AUTH0_MOBILE_CLIENT_ID', process.env.AUTH0_MOBILE_CLIENT_ID),
2830
mgmtClientId: checkAndPrintWarning('AUTH0_MGMT_CLIENT_ID', process.env.AUTH0_MGMT_CLIENT_ID),
2931
mgmtClientSecret: checkAndPrintWarning('AUTH0_MGMT_CLIENT_SECRET', process.env.AUTH0_MGMT_CLIENT_SECRET),
3032
mgmtClientAudience: checkAndPrintWarning('AUTH0_MGMT_CLIENT_AUDIENCE', process.env.AUTH0_MGMT_CLIENT_AUDIENCE),

src/js/auth/mobile.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ if (process.env.MOBILE_AUTH_SECRET == null) {
88
console.warn('Mobile auth secret not found')
99
}
1010

11-
const { clientSecret, clientId, issuer } = AUTH_CONFIG_SERVER
11+
const { mobileClientId, issuer } = AUTH_CONFIG_SERVER
1212

13-
// Set up Auth0 client
13+
// Set up Auth0 client for mobile (Native app - no client secret needed)
1414
export const auth0Client = new Auth0.AuthenticationClient({
1515
domain: issuer.replace('https://', ''),
16-
clientId,
17-
clientSecret
16+
clientId: mobileClientId
1817
})
1918

2019
export const isNullOrEmpty = (str: string | null | undefined): boolean => {

0 commit comments

Comments
 (0)