✨ (login) show login only when not logged in
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<script lang="ts" setup>
|
||||
import { useGitHubLogin } from '@/hooks/useGitHubLogin.hook'
|
||||
|
||||
const GITHUB_URL = 'https://github.com/login/oauth/authorize'
|
||||
|
||||
const CLIENT_ID = 'Iv1.12dc43d013ce3623'
|
||||
const SCOPE = 'repo'
|
||||
const REDIRECT_URI = window.location.origin
|
||||
const { isLogged } = useGitHubLogin()
|
||||
|
||||
const url = new URL(GITHUB_URL)
|
||||
url.searchParams.set('client_id', CLIENT_ID)
|
||||
@@ -14,7 +17,7 @@ const href = url.toString()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a :href="href" class="sign-in-github button is-primary">
|
||||
<a :href="href" class="sign-in-github button is-primary" v-if="!isLogged">
|
||||
<span>
|
||||
Sign in with
|
||||
<img src="@/assets/icons/github.svg" alt="GitHub" />
|
||||
|
||||
Reference in New Issue
Block a user