mirror of
https://github.com/bitinflow/nuxt-oauth.git
synced 2026-03-13 13:45:59 +00:00
Fix ref for watch
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {useAuth} from "#imports";
|
||||
import {useAuth, useNuxtApp} from "#imports";
|
||||
|
||||
const {user, signOut} = await useAuth();
|
||||
|
||||
@@ -7,6 +7,15 @@ definePageMeta({
|
||||
middleware: ["auth"]
|
||||
})
|
||||
|
||||
const { $api } = useNuxtApp()
|
||||
|
||||
$api.get('users/@me')
|
||||
.then((response: any) => {
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.log(error)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user