2025-06-29 17:22:25 +08:00
|
|
|
<template>
|
2025-06-30 16:39:38 +08:00
|
|
|
<n-button type="primary" @click="login">登录</n-button>
|
|
|
|
|
|
|
|
|
|
|
|
<n-button @click="handleLogin">Log out</n-button>
|
2025-06-29 17:22:25 +08:00
|
|
|
</template>
|
|
|
|
|
2025-06-30 15:13:39 +08:00
|
|
|
<script setup>
|
2025-06-30 16:39:38 +08:00
|
|
|
import { useAuth0 } from '@auth0/auth0-vue';
|
|
|
|
const { loginWithRedirect,logout } = useAuth0();
|
|
|
|
const login = () => {
|
|
|
|
loginWithRedirect();
|
|
|
|
}
|
|
|
|
const handleLogin = () => {
|
|
|
|
logout({ logoutParams: { returnTo: window.location.origin } });
|
|
|
|
}
|
2025-06-29 17:22:25 +08:00
|
|
|
</script>
|
2025-06-30 15:13:39 +08:00
|
|
|
|
2025-06-30 16:39:38 +08:00
|
|
|
<style lang="scss" scoped></style>
|