You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jnt0r , think more examples and an explanation of the flow in the README would be enough for most users.
I'm happy to help you polish it if you write a draft. I just don't have enough understanding of how it all works to do it myself.
Does this look right to you or is there a better way of doing it?
// only authenticated users may access this Vue app// the auth should apply to the entire site, not just select routesrouter.beforeEach(async()=>{// an early exit if the user has been auth'd earlierif(AuthenticationState&&AuthenticationState.authenticated){returntrue;}// it could that the authentication is still in progress// the problem with this call is that it never returns if authenticatedconstisAuthed=awaitAuthenticationState.getAuthenticatedAsPromise();// try to log in if not authenticated up to this pointif(!isAuthed){// this redirects to Auth0 login form, but sometimes it just logs me in// even if I delete all auth0 cookiesauth.loginWithRedirect();}// recheck if the user was logged in successfully// redirect to a public welcome page on failureif(!auth||!auth.authenticated){console.log("failed to auth");location.assign("https://stackmuncher.com");}// all navigationreturntrue;});
More detailed and structured documentation. Maybe describe all available methods and properties.
Possibly with GitHub pages or as GitHub wiki?
The text was updated successfully, but these errors were encountered: