Fix type errors
This commit is contained in:
@ -23,6 +23,9 @@ export const useAuthTokenStore = defineStore('authtoken', {
|
||||
async login(username: string, password: string): Promise<boolean> {
|
||||
try {
|
||||
const response = await SshecretAdmin.loginForAccessTokenApiV1TokenPost({ body: { username, password } })
|
||||
if (!response.data) {
|
||||
return false
|
||||
}
|
||||
const tokenData: Token = response.data
|
||||
const accessToken = tokenData.access_token
|
||||
const refreshToken = tokenData.refresh_token
|
||||
@ -53,6 +56,9 @@ export const useAuthTokenStore = defineStore('authtoken', {
|
||||
try {
|
||||
console.log("Refreshing token")
|
||||
const response = await SshecretAdmin.refreshTokenApiV1RefreshPost({ body: { grant_type: "refresh_token", refresh_token: this.refreshToken } })
|
||||
if (!response.data) {
|
||||
return false
|
||||
}
|
||||
const tokenData: Token = response.data
|
||||
const accessToken = tokenData.access_token
|
||||
const refreshToken = tokenData.refresh_token
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// stores/useAlertsStore.ts
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
interface Alert {
|
||||
export interface Alert {
|
||||
id: number
|
||||
message: string
|
||||
title?: string
|
||||
|
||||
Reference in New Issue
Block a user