feat: мультироль
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m6s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 26s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 2m6s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 26s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
This commit is contained in:
@@ -74,7 +74,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
return true
|
||||
}
|
||||
|
||||
async function completeMicrosoftLogin(code: string, state: string | null) {
|
||||
async function completeMicrosoftLogin(code: string, _state: string | null) {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
@@ -136,8 +136,10 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
user.value = nextUser
|
||||
}
|
||||
|
||||
function switchRole() {
|
||||
error.value = 'Смена роли доступна только через backend.'
|
||||
function setActiveRole(role: User['activeRole']) {
|
||||
if (!user.value || !user.value.roles.includes(role)) return false
|
||||
user.value = { ...user.value, activeRole: role }
|
||||
return true
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -154,6 +156,6 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
logout,
|
||||
clearSession,
|
||||
setUser,
|
||||
switchRole,
|
||||
setActiveRole,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user