So I’m trying to use Auth0 to secure my API
My login flow is as follows on button press
Auth0
.webAuth()
.scope("openid profile offline_access read:current_user read: current_user_metadata update:current_user_metadata")
.start { result in
switch result {
case .success(let credentials):
Task {
await landingViewModel.saveCredentials(credentials: credentials)
await rootViewModel.checkAuthStatus()
}
case .failure(let error):
print("Failed with: \(error)")
}
}
When I add audience(AUTH0_DOMAIN/api/v2
I can use the user metadata correctly, but I then can’t use my API because it has a different audience.
I’m unable to figure out how to get a new token without using webAuth
all over again