From d49a4196c77c59fe6005ca763188808ce92f50dd Mon Sep 17 00:00:00 2001 From: Phantasm Date: Tue, 25 Mar 2025 22:24:58 +0100 Subject: [PATCH] Use pinia oauth store in mfa forms Taken from 216d318bb522d02c092b3a4be26cfa31f7e918a3 --- changelog.d/pinia-oauth-mfa.skip | 0 src/components/mfa_form/recovery_form.js | 6 ++++-- src/components/mfa_form/totp_form.js | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 changelog.d/pinia-oauth-mfa.skip diff --git a/changelog.d/pinia-oauth-mfa.skip b/changelog.d/pinia-oauth-mfa.skip new file mode 100644 index 000000000..e69de29bb diff --git a/src/components/mfa_form/recovery_form.js b/src/components/mfa_form/recovery_form.js index 01a62a503..66778b4f6 100644 --- a/src/components/mfa_form/recovery_form.js +++ b/src/components/mfa_form/recovery_form.js @@ -1,5 +1,7 @@ import mfaApi from '../../services/new_api/mfa.js' 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 { faTimes @@ -18,9 +20,9 @@ export default { ...mapGetters({ authSettings: 'authFlow/settings' }), + ...mapStores(useOAuthStore), ...mapState({ instance: 'instance', - oauth: 'oauth' }) }, methods: { @@ -28,7 +30,7 @@ export default { ...mapActions({ login: 'authFlow/login' }), clearError () { this.error = false }, submit () { - const { clientId, clientSecret } = this.oauth + const { clientId, clientSecret } = this.oauthStore const data = { clientId, diff --git a/src/components/mfa_form/totp_form.js b/src/components/mfa_form/totp_form.js index 6ee823ed3..e347e017a 100644 --- a/src/components/mfa_form/totp_form.js +++ b/src/components/mfa_form/totp_form.js @@ -1,5 +1,7 @@ import mfaApi from '../../services/new_api/mfa.js' 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 { faTimes @@ -18,9 +20,9 @@ export default { ...mapGetters({ authSettings: 'authFlow/settings' }), + ...mapStores(useOAuthStore), ...mapState({ instance: 'instance', - oauth: 'oauth' }) }, methods: { @@ -28,7 +30,7 @@ export default { ...mapActions({ login: 'authFlow/login' }), clearError () { this.error = false }, submit () { - const { clientId, clientSecret } = this.oauth + const { clientId, clientSecret } = this.oauthStore const data = { clientId,