mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 07:48:37 +02:00
Use Groups store in Options view to remove a request
This commit is contained in:
10
resources/js_vue3/stores/user.js
vendored
10
resources/js_vue3/stores/user.js
vendored
@ -29,22 +29,22 @@ export const useUserStore = defineStore({
|
||||
*
|
||||
* @param {object} user
|
||||
*/
|
||||
loginAs(user) {
|
||||
async loginAs(user) {
|
||||
this.$patch(user)
|
||||
this.initDataStores()
|
||||
await this.initDataStores()
|
||||
this.applyUserPrefs()
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes the user's data stores
|
||||
*/
|
||||
initDataStores() {
|
||||
async initDataStores() {
|
||||
const accounts = useTwofaccounts()
|
||||
const groups = useGroups()
|
||||
|
||||
if (this.isAuthenticated) {
|
||||
accounts.fetch()
|
||||
groups.fetch()
|
||||
await accounts.fetch()
|
||||
await groups.fetch()
|
||||
}
|
||||
else {
|
||||
accounts.$reset()
|
||||
|
Reference in New Issue
Block a user