rubyforgood / rubyforgood/casa

Endpoint /api/v1/users/refresh_token generates new access token on request

Open
#6,233 3 comments 0 reactions 0 assignees View on GitHub

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_token post route to api/v1/ (/api/v1/users/refresh_token)
  • Regenerates the current api_token and replaces old api_token_digest with hashed version of new token
  • Route accepts refresh_token and returns session_blueprint data with new api_token
Helpful Links

API Folder Structure
Blueprint

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.