-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic user details are pulled into the template now
- Loading branch information
Showing
11 changed files
with
130 additions
and
35 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,5 +1,5 @@ | ||
<template> | ||
<main> | ||
<NuxtLayout> | ||
<NuxtPage /> | ||
</main> | ||
</NuxtLayout> | ||
</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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<nav class="max-width lg"> | ||
<section> | ||
<span class="logo">Supabase Auth Example</span> | ||
</section> | ||
<section> | ||
<button type="button" class="clear" @click="signOut">Log Out</button> | ||
</section> | ||
</nav> | ||
</template> | ||
|
||
<script setup> | ||
const supabase = useSupabaseClient() | ||
const user = useSupabaseUser() | ||
const signOut = async () => { | ||
const { error } = await supabase.auth.signOut() | ||
if (error) console.log(error) | ||
navigateTo('/login') | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use 'assets/variables' as *; | ||
nav { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: $spacing-sm $spacing-md; | ||
background: rgba($brand, 1); | ||
border-radius: $br-xxl; | ||
color: $white; | ||
position: sticky; | ||
top: $spacing-md; | ||
} | ||
</style> |
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,9 @@ | ||
<template> | ||
<main> | ||
<slot /> | ||
</main> | ||
</template> | ||
|
||
<script setup> | ||
</script> |
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,14 @@ | ||
<template> | ||
<main> | ||
<Navigation /> | ||
<main> | ||
<slot /> | ||
</main> | ||
</main> | ||
</template> | ||
|
||
<script setup> | ||
import Navigation from '~/components/Navigation.vue' | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<main class="max-width lg"> | ||
<section id="UserDetails"> | ||
<h1>Hello!</h1> | ||
<p>You are logged in with the email address, <i>{{ user.email }}</i>.</p> | ||
<table> | ||
<tr v-if="user.user_metadata.full_name"> | ||
<td>Display Name:</td> | ||
<td>{{ user.user_metadata.full_name }}</td> | ||
</tr> | ||
<tr v-if="user.app_metadata.provider == 'github'"> | ||
<td>Github Avatar:</td> | ||
<td><img :src="user.user_metadata.avatar_url" class="github-avatar" alt="Avatar" /></td> | ||
</tr> | ||
</table> | ||
</section> | ||
</main> | ||
</template> | ||
|
||
<script setup> | ||
definePageMeta({ | ||
layout: 'default' | ||
}); | ||
const user = useSupabaseUser() | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use 'assets/variables' as *; | ||
#UserDetails { | ||
padding: $spacing-lg; | ||
.github-avatar { | ||
width: 72px; | ||
border-radius: $br-md; | ||
border: $border; | ||
} | ||
} | ||
</style> |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.