perarnborg / vuex-oidc

Vuejs (with vuex) wrapper for open id authentication
MIT License
232 stars 64 forks source link

Explicitly use a not logged in page #207

Open svituz opened 1 year ago

svituz commented 1 year ago

Hi @perarnborg, thanks for this great package. In my application, I would like the user to explicitly click on a login button when s/he tries to access a private page, instead of redirecting the browser directly to the OIDC login. For example, let's say I have one route:

{
    path: '/private-page',
    component: MyComponent,
    meta: { isPublic: false }
}

If the user is not logged in and tries to access '/private-page', I want him/her to be redirected to a page where, for example, a message "You must login to access this page" is returned. Then when the user explicetely clicks on a Login button, the login is process started. Is it possible to do that?