Prepend "Bearer"
This commit is contained in:
parent
fdb3fdb861
commit
69d5002cfd
|
@ -35,7 +35,7 @@ export async function login(
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...user,
|
...user,
|
||||||
jwt
|
token: `Bearer ${jwt}`
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error.message)
|
console.log(error.message)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AuthResult } from './AuthResult'
|
import { AuthResult } from './AuthResult'
|
||||||
|
|
||||||
export type LoginResult = AuthResult & {
|
export type LoginResult = AuthResult & {
|
||||||
jwt?: string
|
token?: string
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,6 +95,8 @@ async function doLogin() {
|
||||||
})
|
})
|
||||||
|
|
||||||
emit('login', loginResult)
|
emit('login', loginResult)
|
||||||
|
|
||||||
|
console.log(loginResult)
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.log(e.message)
|
console.log(e.message)
|
||||||
error.value = e.message
|
error.value = e.message
|
||||||
|
|
|
@ -18,7 +18,7 @@ import IpAlert from '../components/IpAlert.vue'
|
||||||
import Logo from '../components/Logo.vue'
|
import Logo from '../components/Logo.vue'
|
||||||
import LoggedCard from '../components/LoggedCard.vue'
|
import LoggedCard from '../components/LoggedCard.vue'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { LoginResult } from '@/server/schemas/Auth'
|
import { LoginResult } from '@/server/schemas/LoginResult'
|
||||||
|
|
||||||
const loginResult = ref<LoginResult | null>(null)
|
const loginResult = ref<LoginResult | null>(null)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user