nativescript-auth0 icon indicating copy to clipboard operation
nativescript-auth0 copied to clipboard

Logout feature

Open Nevaan opened this issue 6 years ago • 2 comments

Hi,

I am using this plugin to authenticate via Auth0 (nativescript + angular project), and so far I am able to succesfully login, but I am having problem with logout functionality. Initially, when I call webAuthentication method I am redirected to browser, here I enter credentials and I am redirected back to application - that is good when I am doing so for the first time. But in case I logout (in my application - before token expires), and call webAuthentication method again, the browser pops out, authenticates me automatically and redirects to the application, which may not be a desired scenario every time (for example, if I want to log as another user).

I have noticed that if I clear cache of browser (android and iOS - outside of my application, in browser settings) - I am asked to reenter credentials, which is the behavior I want

Do anyone have idea how I can achieve this programatically?

Nevaan avatar Mar 29 '19 15:03 Nevaan

Hi,

I think I was able to achieve it by myself finally. If anyone looked for solution, I have added "prompt" parameter to webAuthentication method like this:

this.auth0.webAuthentication({
        scope: SCOPES,
        scheme: SCHEME,
        parameters: {
          "prompt": "login"
        }
      })

Maybe it would be worth mentioning in plugin documentation and/or demo application? Even reference to auth0 where possible paramteres are described would be helpful.

Nevaan avatar Mar 31 '19 21:03 Nevaan

How does this help logging out @charsleysa ?

mm-spiio avatar Mar 13 '20 10:03 mm-spiio