Closed amitneg1 closed 7 years ago
@amitneg1 You can use lifecycle events to perform this , we check with role ID when ever login page is triggered to login . I have pushed the code with the fix .
loginAuth:function
() {
var app = this;
const status = JSON.parse(window.localStorage.getItem('lbUser'));
if(status === null || status === undefined) {
app.$router.push('/login');
}else if (status.data.role_id === 'ADMIN') {
app.$router.push('/admin');
}else {
app.$router.push('/resident');
}
}`
Thanks Manoj!! Its working. Kudos
Logged in user should not come back on login page. For example Changing URL /admin => /login