-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
10,771 additions
and
5,285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@layer components { | ||
.pre-auth { | ||
@apply bg-gray-800 text-white p-3 my-3 rounded shadow overflow-x-auto; | ||
} | ||
|
||
.pre-auth span { | ||
@apply text-green-400; | ||
} | ||
} | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
const { status, data, signOut, signIn } = useSession(); | ||
</script> | ||
|
||
<template> | ||
<div class="w-full max-w-5xl mx-auto bg-white px-5 py-4 rounded-t shadow-xl"> | ||
<div class="flex items-center justify-between"> | ||
<div class="flex items-center space-x-2"> | ||
<img | ||
v-if="status === 'authenticated' && data?.user?.image" | ||
class="w-12 h-12 rounded-full" | ||
:src="data.user.image" | ||
alt="User Avatar" /> | ||
<h1 v-if="status === 'authenticated'" class="text-lg">Authenticated as {{ data?.user?.name }}!</h1> | ||
<h1 v-else>Not logged in</h1> | ||
</div> | ||
<button | ||
v-if="status === 'authenticated'" | ||
class="flex items-center justify-center space-x-2 bg-red-500 text-white rounded-lg py-2 px-3 text-lg" | ||
@click="signOut({ callbackUrl: '/' })"> | ||
<span>Logout</span> | ||
</button> | ||
<button | ||
v-else | ||
class="flex items-center justify-center space-x-2 bg-green-500 text-white rounded-lg py-2 px-3 text-lg" | ||
@click="signIn()"> | ||
<i class="fa fa-right-to-bracket pt-0.5" /> | ||
<span>Login</span> | ||
</button> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
// https://nuxt.com/docs/api/configuration/nuxt-config | ||
export default defineNuxtConfig({ | ||
css: ['@/assets/tailwindcss.css'], | ||
modules: ['@nuxtjs/tailwindcss'] | ||
modules: ['@nuxtjs/tailwindcss', '@sidebase/nuxt-auth'], | ||
auth: { | ||
origin: 'http://localhost:3000' | ||
} | ||
}); |
Oops, something went wrong.