Skip to content

[EDIFIKANA] #425 Password reset backend (Phase 0)#458

Merged
gaaliciA1990 merged 3 commits intomainfrom
alg/425_password_reset_BE
Mar 27, 2026
Merged

[EDIFIKANA] #425 Password reset backend (Phase 0)#458
gaaliciA1990 merged 3 commits intomainfrom
alg/425_password_reset_BE

Conversation

@gaaliciA1990
Copy link
Copy Markdown
Contributor

Summary

  • Adds POST /user/request-password-reset public endpoint (no auth required)
  • Calls supabase.auth.resetPasswordForEmail(email) and always returns HTTP 200 to prevent email enumeration
  • Implements AuthServiceImpl.passwordReset() to call the new endpoint
  • Adds 2 unit tests and 2 integration tests

Closes #425

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 24, 2026 00:15
@gaaliciA1990 gaaliciA1990 requested a review from CRamsan March 24, 2026 00:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the first backend slice of password reset by introducing a public password-reset-request endpoint backed by Supabase Auth, and wiring the front-end service to call it while preventing email enumeration via always-200 behavior.

Changes:

  • Added POST /user/request-password-reset API operation + shared request model (PasswordResetNetworkRequest)
  • Implemented backend flow (UserControllerUserServiceUserDatastore/Supabase) that suppresses failures and returns success
  • Added unit tests for UserService.requestPasswordReset and integration tests for SupabaseUserDatastore.requestPasswordReset

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
edifikana/shared/src/commonMain/kotlin/com/cramsan/edifikana/lib/model/network/PasswordResetNetworkRequest.kt Adds shared network request body for password reset requests
edifikana/front-end/shared-app/src/commonMain/kotlin/com/cramsan/edifikana/client/lib/service/impl/AuthServiceImpl.kt Implements passwordReset() by calling the new backend endpoint
edifikana/back-end/src/test/kotlin/com/cramsan/edifikana/server/service/UserServiceTest.kt Adds unit tests validating “always success” behavior to prevent enumeration
edifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/service/UserService.kt Adds service method that suppresses datastore failures and always returns success
edifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/datastore/UserDatastore.kt Extends datastore interface with requestPasswordReset
edifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/datastore/supabase/SupabaseUserDatastore.kt Implements password reset via auth.resetPasswordForEmail
edifikana/back-end/src/main/kotlin/com/cramsan/edifikana/server/controller/UserController.kt Registers unauthenticated handler for password reset requests
edifikana/back-end/src/integTest/kotlin/com/cramsan/edifikana/server/datastore/supabase/SupabaseUserDatastoreIntegrationTest.kt Adds integration tests for reset request success paths
edifikana/api/src/commonMain/kotlin/com/cramsan/edifikana/api/UserApi.kt Adds API operation definition for requestPasswordReset

@gaaliciA1990 gaaliciA1990 force-pushed the alg/425_password_reset_BE branch from 9005ad0 to 070cbee Compare March 25, 2026 15:56
@gaaliciA1990 gaaliciA1990 merged commit 524009a into main Mar 27, 2026
2 checks passed
@gaaliciA1990 gaaliciA1990 deleted the alg/425_password_reset_BE branch March 27, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] Password Reset Backend — UserApi extension and UserController (Phase 0)

3 participants