Cleaned up login/logout flows.
This commit is contained in:
@@ -27,9 +27,9 @@ const handleLogin = async () => {
|
||||
await authStore.authenticate()
|
||||
authStore.showMessage('Authentication successful!', 'success', 2000)
|
||||
if (authStore.restrictedMode) {
|
||||
// In restricted mode after successful auth show permission denied (no profile outside /auth/)
|
||||
authStore.currentView = 'permission-denied'
|
||||
} else if (location.pathname.startsWith('/auth/')) {
|
||||
// Restricted mode: reload so the app re-mounts and selectView() applies (will become permission denied)
|
||||
location.reload()
|
||||
} else if (location.pathname === '/auth/') {
|
||||
authStore.currentView = 'profile'
|
||||
} else {
|
||||
location.reload()
|
||||
|
||||
@@ -32,7 +32,6 @@ function back() {
|
||||
}
|
||||
async function logout() {
|
||||
await authStore.logout()
|
||||
authStore.currentView = 'login'
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@@ -144,7 +144,6 @@ const deleteCredential = async (credentialId) => {
|
||||
|
||||
const logout = async () => {
|
||||
await authStore.logout()
|
||||
authStore.currentView = 'login'
|
||||
}
|
||||
|
||||
const isAdmin = computed(() => !!(authStore.userInfo?.is_global_admin || authStore.userInfo?.is_org_admin))
|
||||
|
||||
Reference in New Issue
Block a user