Skip to content

Commit 8051228

Browse files
committed
feat: add user ID to User type and initialize user state in AuthProvider
1 parent a796a2a commit 8051228

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/features/auth/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type User = {
2+
id: string
23
name: string
34
imageURL?: string
45
streak?: number

src/providers/AuthProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
2626

2727
initState({
2828
user: {
29+
id: user.uid,
2930
name: user.displayName || 'Anonymous',
3031
imageURL: user.photoURL || '',
3132
},

0 commit comments

Comments
 (0)