Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Liry24 committed Feb 26, 2025
1 parent aa9f873 commit 365542c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions composables/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const userProfile = ref<{ name: string | null; avatar: string | null }>({
});

export const useSignOut = async () => {
const supabase = await useSupabaseClient();
const supabase = useSupabaseClient();
await supabase.auth.signOut();
navigateTo('/');
};
Expand All @@ -28,7 +28,7 @@ export const useSignUp = async (
password: string,
token: string
) => {
const supabase = await useSupabaseClient();
const supabase = useSupabaseClient();

const { error } = await supabase.auth.signUp({
email: email,
Expand All @@ -41,7 +41,7 @@ export const useSignUp = async (
};

export const useLoginWithTwitter = async () => {
const supabase = await useSupabaseClient();
const supabase = useSupabaseClient();

const { error } = await supabase.auth.signInWithOAuth({
provider: 'twitter',
Expand Down
14 changes: 7 additions & 7 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import tailwindcss from '@tailwindcss/vite';
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(
import.meta.env.SUPABASE_URL,
import.meta.env.SUPABASE_ANON_KEY
);

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
future: { compatibilityVersion: 4 },
Expand Down Expand Up @@ -162,7 +157,12 @@ export default defineNuxtConfig({
'/bookmarks',
],
urls: async () => {
const permament = [
const supabase = createClient(
import.meta.env.SUPABASE_URL,
import.meta.env.SUPABASE_ANON_KEY
);

const permanent = [
{
loc: '/',
images: [
Expand Down Expand Up @@ -231,7 +231,7 @@ export default defineNuxtConfig({
return { loc: `/@${user.id}` };
});

return [...permament, ...setups, ...users];
return [...permanent, ...setups, ...users];
},
},
supabase: {
Expand Down

0 comments on commit 365542c

Please sign in to comment.