Skip to content

Feature/6210 - Endpoint API remember_me option#6263

Merged
compwron merged 6 commits into
rubyforgood:mainfrom
JustinTan-1:feature/remember-me
Mar 20, 2025
Merged

Feature/6210 - Endpoint API remember_me option#6263
compwron merged 6 commits into
rubyforgood:mainfrom
JustinTan-1:feature/remember-me

Conversation

@JustinTan-1
Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Resolves #6210

What changed, and why?

Add remember_me parameter to API endpoint to update refresh token expiry to 1 year.

  • Update return_new_refresh_token to include boolean parameter
  • Permit remember_me boolean param in controller and pass to blueprint to retrieve a refresh token with updated expiry date

Why?
Users have the option for the refresh token to expire after 1 yr instead of 30 days for extended sessions.

How is this tested? (please write tests!) 💖💪

2 tests for both return_new_refresh_token(true) and return_new_refresh_token(false) - spec/models/api_credential_spec.rb
Tested API endpoint with curl.

Screenshots please :)

IMG_5212

@JustinTan-1 JustinTan-1 reopened this Mar 18, 2025
end
end

describe "#generate_refresh_token_with_rememberme" do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be "remember_me"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

missing a _

Copy link
Copy Markdown
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

seems harmless. Agreed that there is a nit in a test name but that is not a merge blocker. Do fix it in a followup.

@compwron compwron merged commit 88620f5 into rubyforgood:main Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "remember_me" option to /api/v1/users/sign_in endpoint

3 participants