Skip to content

Commit

Permalink
rename getUser to initializeSession
Browse files Browse the repository at this point in the history
  • Loading branch information
ccatherinetan committed Nov 19, 2024
1 parent a538a8c commit bbbacb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"husky": "^9.1.5",
"prettier": "^3.3.3",
"typescript": "5.4",
"typescript": "5.4",
"yarnhook": "^0.6.2"
}
}
6 changes: 3 additions & 3 deletions utils/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {

// Fetch the current user
useEffect(() => {
const getUser = async () => {
const initializeSession = async () => {
setLoading(true);
const { data, error } = await supabase.auth.getSession();
if (error) {
Expand All @@ -62,7 +62,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
setAll(data.session);
setLoading(false);
};
getUser();
initializeSession();

// Listen for auth state changes
const {
Expand All @@ -72,7 +72,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
});

return () => subscription?.unsubscribe();
}, []);
}, [setAll]);

// Sign Up function
const signUp = useCallback(async (email: string, password: string) => {
Expand Down

0 comments on commit bbbacb4

Please sign in to comment.