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

This commit is contained in:
2026-05-11 21:29:16 +03:00
parent 3b0bbfc858
commit 6824d7ce7d
29 changed files with 1350 additions and 95 deletions
+6 -4
View File
@@ -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,
}
})