Fix Login saving old user state
This commit is contained in:
parent
9244e94dd7
commit
784dd60bef
@ -2,7 +2,7 @@
|
||||
import ThemeToggle from './ThemeToggle.vue'
|
||||
|
||||
const props = defineProps(['modelValue'])
|
||||
defineEmits(['update:modelValue'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
async function signout(ev) {
|
||||
ev.preventDefault()
|
||||
@ -16,6 +16,7 @@ async function signout(ev) {
|
||||
}
|
||||
let resp = await fetch(api_url, fetch_options)
|
||||
console.log(resp)
|
||||
emit('update:modelValue', '')
|
||||
window.location.reload()
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -22,7 +22,7 @@ async function login(ev) {
|
||||
|
||||
let resp = await fetch(api_url, fetch_options)
|
||||
if (resp.ok) {
|
||||
emit('update:modelValue', user.value)
|
||||
emit('update:modelValue', await resp.json())
|
||||
window.location.hash = "/"
|
||||
} else {
|
||||
user.value = ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user