Commit fec5fc6
committed
server: move Firebase auth to server-side endpoints
Migrate Firebase authentication from client-side SDK to server-side
endpoints that call the Firebase REST API. This reduces client bundle
size by removing the Firebase SDK dependencies (~80-200KB) and enables
future migration to alternative auth backends.
The implementation includes:
- Email/password auth endpoints (/auth/login, /auth/signup, etc.)
- OAuth handlers for Google and Apple Sign-In with full server-side
token exchange
- Firestore-backed OAuth state storage for CSRF protection
- Full cryptographic verification of Apple ID tokens using JWKS
- Return URL validation to prevent open redirect attacks
- User protobuf schema extended with providerUserId for stable
OAuth provider identity
Client code now uses simple redirects for OAuth and fetch calls for
email/password auth, with all Firebase SDK code removed.1 parent 007d3fb commit fec5fc6
32 files changed
Lines changed: 5179 additions & 291 deletions
File tree
- config
- src
- app
- server
- auth
- models
- schemas
- tests
- ui-tests/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 7 | | |
17 | 8 | | |
18 | 9 | | |
| |||
25 | 16 | | |
26 | 17 | | |
27 | 18 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 19 | | |
35 | 20 | | |
36 | 21 | | |
| |||
42 | 27 | | |
43 | 28 | | |
44 | 29 | | |
45 | | - | |
46 | | - | |
| 30 | + | |
| 31 | + | |
47 | 32 | | |
48 | 33 | | |
49 | 34 | | |
| |||
75 | 60 | | |
76 | 61 | | |
77 | 62 | | |
78 | | - | |
| 63 | + | |
79 | 64 | | |
80 | 65 | | |
81 | 66 | | |
| |||
87 | 72 | | |
88 | 73 | | |
89 | 74 | | |
90 | | - | |
91 | | - | |
92 | 75 | | |
93 | 76 | | |
94 | 77 | | |
| |||
97 | 80 | | |
98 | 81 | | |
99 | 82 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 83 | | |
107 | 84 | | |
108 | | - | |
109 | 85 | | |
110 | 86 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 87 | | |
115 | 88 | | |
116 | 89 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | 90 | | |
179 | 91 | | |
180 | 92 | | |
181 | 93 | | |
182 | 94 | | |
183 | 95 | | |
184 | | - | |
185 | 96 | | |
186 | 97 | | |
187 | 98 | | |
| |||
230 | 141 | | |
231 | 142 | | |
232 | 143 | | |
233 | | - | |
234 | | - | |
235 | 144 | | |
236 | 145 | | |
237 | | - | |
| 146 | + | |
238 | 147 | | |
239 | 148 | | |
240 | 149 | | |
| |||
0 commit comments