Skip to content

Enhance endpoint security for /api/v1/users/sign_in with randomization #6207

@7riumph

Description

@7riumph

Part of epic #3942

What type of user does this affect?

  • volunteers

How should it operate? ⚙️🛠️

Endpoint can now output randomized token and refresh_token on successful /api/v1/sign_in request.

Additionally, since tokens now expire, user model has token_expires_at and refresh_token_expires_at datetimes.

Acceptance Criteria

  • Expands the user model to handle both the token and refresh token, as well as their expiration times.
  • Creates functions to generate randomized tokens in user.rb and set default expiration to 7 hours and 30 days
  • Updates session controller and base controller with new details if applicable

Edit: Made api_credentials table and put randomized functions in new models/api_credential.rb that belongs to user

Helpful Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    codethechangefor codethechange developers

    Type

    No type

    Projects

    Status

    Merged to QA

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions