-
Notifications
You must be signed in to change notification settings - Fork 0
[SECURITY] Move password update to client-side Supabase API (Phase 3) #447
Copy link
Copy link
Open
Milestone
Description
Context
SupabaseUserDatastore.updatePassword was calling adminApi.updateUserById() (service-role key) to set a user's password server-side, bypassing current-password verification. This is a security risk — the server should not be responsible for password management using the admin API.
Change
- Complete
AuthServiceImpl.changePasswordto useauth.updateUser { password = newPassword.reveal() }directly after verifying the current password viaauth.signInWith(Email)
Notes
- Current password is verified by re-authenticating via Supabase before calling
auth.updateUser— this ensures only the account owner can change the password - The
canPasswordAuthflag inauthMetadata(previously updated server-side after password change) is no longer updated as part of this flow. A follow-up ticket should determine the correct place to set this flag (e.g., a lightweight server endpoint called after client-sideauth.updateUsersucceeds, or a Supabase webhook/trigger)
What type of task is this?
Security / Bug Fix
Related to #215
Reactions are currently unavailable