rubyforgood / rubyforgood/casa
Endpoint /api/v1/users/refresh_token generates new access token on request
Open
Nobody has claimed this yet.
codethechange
no-issue-activity
- Dominant language
- Ruby
- Stars
- 381
- Forks
- 542
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 47
Description
Part of epic #3942
What type of user does this affect?
- volunteers
How should it operate? ⚙️🛠️
There should now be a api/v1/users/refresh_token route to generate new access tokens (api_token).
Acceptance Criteria
- Adds
refresh_tokenpost route toapi/v1/(/api/v1/users/refresh_token) - Regenerates the current
api_tokenand replaces oldapi_token_digestwith hashed version of new token - Route accepts
refresh_tokenand returnssession_blueprintdata with newapi_token
Helpful Links
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the app/controllers/api/v1 folder and read the existing session-related routes and the session_blueprint at app/blueprints/api/v1/session_blueprint.rb. Trace how API tokens and their digests are currently handled, then verify that the refresh_token POST route accepts a refresh token, replaces the digest, and returns the blueprint data with a new api_token.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100