Use pinia oauth store in mfa forms

Taken from 216d318bb5
This commit is contained in:
Phantasm 2025-03-25 22:24:58 +01:00
parent f1910b37d3
commit d49a4196c7
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
3 changed files with 8 additions and 4 deletions

View file

View file

@ -1,5 +1,7 @@
import mfaApi from '../../services/new_api/mfa.js' import mfaApi from '../../services/new_api/mfa.js'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { mapStores } from 'pinia'
import { useOAuthStore } from 'src/stores/oauth.js'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
import { import {
faTimes faTimes
@ -18,9 +20,9 @@ export default {
...mapGetters({ ...mapGetters({
authSettings: 'authFlow/settings' authSettings: 'authFlow/settings'
}), }),
...mapStores(useOAuthStore),
...mapState({ ...mapState({
instance: 'instance', instance: 'instance',
oauth: 'oauth'
}) })
}, },
methods: { methods: {
@ -28,7 +30,7 @@ export default {
...mapActions({ login: 'authFlow/login' }), ...mapActions({ login: 'authFlow/login' }),
clearError () { this.error = false }, clearError () { this.error = false },
submit () { submit () {
const { clientId, clientSecret } = this.oauth const { clientId, clientSecret } = this.oauthStore
const data = { const data = {
clientId, clientId,

View file

@ -1,5 +1,7 @@
import mfaApi from '../../services/new_api/mfa.js' import mfaApi from '../../services/new_api/mfa.js'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { mapStores } from 'pinia'
import { useOAuthStore } from 'src/stores/oauth.js'
import { library } from '@fortawesome/fontawesome-svg-core' import { library } from '@fortawesome/fontawesome-svg-core'
import { import {
faTimes faTimes
@ -18,9 +20,9 @@ export default {
...mapGetters({ ...mapGetters({
authSettings: 'authFlow/settings' authSettings: 'authFlow/settings'
}), }),
...mapStores(useOAuthStore),
...mapState({ ...mapState({
instance: 'instance', instance: 'instance',
oauth: 'oauth'
}) })
}, },
methods: { methods: {
@ -28,7 +30,7 @@ export default {
...mapActions({ login: 'authFlow/login' }), ...mapActions({ login: 'authFlow/login' }),
clearError () { this.error = false }, clearError () { this.error = false },
submit () { submit () {
const { clientId, clientSecret } = this.oauth const { clientId, clientSecret } = this.oauthStore
const data = { const data = {
clientId, clientId,