feat: DAH-4253 Authenticate housing counselor access with sign in link - #3033
Open
cliu02 wants to merge 10 commits into
Open
feat: DAH-4253 Authenticate housing counselor access with sign in link #3033cliu02 wants to merge 10 commits into
cliu02 wants to merge 10 commits into
Conversation
alulabeshue-sfgov
temporarily deployed
to
dahlia-webap-dah-4253-a-c3edar
August 18, 2026 15:21
Inactive
cliu02
marked this pull request as ready for review
August 18, 2026 15:35
cliu02
requested review from
a team,
cade-exygy and
jtcaovan
and removed request for
a team
August 18, 2026 15:36
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a housing-counselor “access” authentication flow (backed by Salesforce checks) and wires it into the sign-in experience so counselors can follow an access link containing a JWT.
Changes:
- Add
POST /api/v1/housing-counselor/accessendpoint + controller/service logic to authorize counselor access to an applicant. - Update sign-in UI flow to avoid auto-redirect when an access token (
t) is present and to validate access after sign-in. - Add/extend Ruby and JS tests for the new service/controller/API client behaviors.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/services/force/housing_counselor_service_spec.rb | Adds specs for authorize_access and restructures shared request stubbing. |
| spec/controllers/api/v1/housing_counselor_controller_spec.rb | Adds controller specs for the new POST #access endpoint. |
| config/routes.rb | Adds POST /api/v1/housing-counselor/access route. |
| app/services/force/housing_counselor_service.rb | Implements counselor/applicant authorization and denial logging. |
| app/controllers/api/v1/housing_counselor_controller.rb | Adds access action to validate JWT + authorize using the service. |
| app/javascript/pages/sign-in.tsx | Prevents auto-redirect when t query param is present. |
| app/javascript/authentication/SignInForm.tsx | Calls access-auth endpoint after sign-in / on already-signed-in visits with t. |
| app/javascript/api/authApiService.ts | Adds API client method to post the counselor JWT to the access endpoint. |
| app/javascript/tests/api/authApiService.test.ts | Adds unit test coverage for new API client method. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+75
to
+82
| def self.log_if_not_housing_counselor(counselor, counselor_contact_id) | ||
| return if counselor && counselor['isHousingCounselor'] | ||
|
|
||
| Rails.logger.error( | ||
| 'The currently logged in user with contact ' \ | ||
| "ID=#{counselor_contact_id} is not a housing counselor", | ||
| ) | ||
| end |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a user hits /sign-in?t={token}, authenticate for an active housing counselor who works for the same agency that the applicant specified in the token has granted access to.
Jira ticket
https://sfgovdt.jira.com/browse/DAH-4253
Before requesting eng review
Version Control
angularif it contains updates to Angular codetype: TICKET-NUMBER Descriptionformat, useDAH-000if it does not need a ticketurgent: Descriptionformat if it is urgent and does not need a ticketCode quality
Code conventions
.scssstylesheets andui-seedstokens, rather than inline styles or TailwindReview instructions
Request eng review
needs reviewlabelHousing Enggroup to automatically assign reviewers, and/or assign specific engineersBefore merging
Request product acceptance (PA) testing
needs product acceptancelabel)