Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"authorize" from useAuth0 hook does not accept ephemeralSession properly #539

Closed
ebg1223 opened this issue Oct 20, 2022 · 4 comments
Closed

Comments

@ebg1223
Copy link

ebg1223 commented Oct 20, 2022

const auth0 = new Auth0({
  domain: 
  clientId: 
})

export default function Auth() {
  const { authorize, user, clearSession, webAuth } = useAuth0()

//WORKS CORRECTLY, DOES NOT ASK PERMISSION TO OPEN BROWSER
  const login = async () => {
    await webAuth
      .authorize(
        { scope: 'openid profile email' },
        { ephemeralSession: true } // No SSO, therefore no alert box
      )
      .then((credentials) => console.log(credentials))
      .catch((error) => console.log(error))
  }

//DOES NOT WORK AS EXPECTED. ASKS PERMISSION TO OPEN BROWSER TO auth0
   const loginViaHooks = async () => {
    await authorize(
      {scope: 'openid profile email'},
      {ephemeralSession: true,}
    )
  }

App is wrapped in Auth0 Provider. Login still works successfully either way, and the user object is populated. Just does not respect the ephemeralSession prop for some reason.

@ebg1223 ebg1223 mentioned this issue Oct 20, 2022
2 tasks
@ebg1223
Copy link
Author

ebg1223 commented Oct 20, 2022

Submitted a fix in PR:
#540

@moribaleta
Copy link

is there a way to track the ios alert if continue is pressed

@poovamraj
Copy link
Contributor

Hi @moribaleta I am not sure what your question is. Can you please elaborate on it with a possible use case?

@poovamraj
Copy link
Contributor

@ebg1223 the fix for this is currently in master. The other enhancement you provided is in review on a separate PR. We will be releasing them soon, we will keep you updated about this.

Will close this issue for now, feel free to reopen this if you have more doubts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants