use OAuthStore directly
This commit is contained in:
parent
529a2d100b
commit
3984a5aefa
44 changed files with 226 additions and 256 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { defineStore } from 'pinia'
|
||||
|
||||
import { useCredentialsStore } from 'src/stores/credentials.js'
|
||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||
|
||||
import {
|
||||
fetchOAuthTokens,
|
||||
|
|
@ -14,7 +14,7 @@ export const useOAuthTokensStore = defineStore('oauthTokens', {
|
|||
actions: {
|
||||
fetchTokens() {
|
||||
fetchOAuthTokens({
|
||||
credentials: useCredentialsStore().current,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((tokens) => {
|
||||
this.swapTokens(tokens)
|
||||
})
|
||||
|
|
@ -22,7 +22,7 @@ export const useOAuthTokensStore = defineStore('oauthTokens', {
|
|||
revokeToken(id) {
|
||||
revokeOAuthToken({
|
||||
id,
|
||||
credentials: useCredentialsStore().current,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then((response) => {
|
||||
if (response.status === 201) {
|
||||
this.swapTokens(this.tokens.filter((token) => token.id !== id))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue