forked from pingwu/maca
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.diff
More file actions
65 lines (59 loc) · 2.06 KB
/
changes.diff
File metadata and controls
65 lines (59 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
*** api-service/src/routes/auth.py.orig 2025-02-15
--- api-service/src/routes/auth.py 2025-02-15
***************
*** 288,295 ****
"email": info.get("email", ""),
"name": info.get("name", info.get("given_name", "User")),
}
! # Set session cookie and redirect back to frontend root
! response = RedirectResponse(url=f"{FRONTEND_URL}")
if should_redact():
logger.debug("About to set session cookie for user (email redacted)")
else:
logger.debug(f"About to set session cookie for user: {user.get('email','')}")
--- 288,295 ----
"email": info.get("email", ""),
"name": info.get("name", info.get("given_name", "User")),
}
! # Set session cookie and redirect back to frontend welcome view
! frontend_base = FRONTEND_URL.rstrip("/") if FRONTEND_URL else "http://localhost:3000"
! response = RedirectResponse(url=f"{frontend_base}/welcome")
if should_redact():
logger.debug("About to set session cookie for user (email redacted)")
else:
logger.debug(f"About to set session cookie for user: {user.get('email','')}")
***************
*** 300,303 ****
--- 301,310 ----
*** frontend/src/services/AuthContext.tsx.orig 2025-02-15
--- frontend/src/services/AuthContext.tsx 2025-02-15
***************
*** 12,21 ****
interface AuthContextType {
isAuthenticated: boolean;
checkAuth: () => Promise<void>;
}
--- 12,30 ----
+ interface AuthUser {
+ id: string;
+ email: string;
+ name: string;
+ }
+
interface AuthContextType {
isAuthenticated: boolean;
+ user: AuthUser | null;
+ isLoading: boolean;
checkAuth: () => Promise<void>;
}
***************
*** 25,28 ****
--- 34,39 ----
export const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
const [isAuthenticated, setIsAuthenticated] = useState(false);
+ const [user, setUser] = useState<AuthUser | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
const checkAuth = async () => {
try {
---
*** End Patch