Skip to content

Conversation

FaeyUmbrea
Copy link

@FaeyUmbrea FaeyUmbrea commented Jul 6, 2025

This PR rebases #2428 onto the current master as the original maintainer has gone missing.

The aim is the same as in the original PR. Ory should save tokens its getting on each login. This is helpful in scenarios where the user is encountering a consent screen and the refresh token issues to the backend was invalidated, i.e. through a scope change.

Further, this simplifies implementing applications that might not need to do any background processing and require a login to use. For those usecases the most recent token issued on login is sufficient.

Related issue(s)

#1912
#2428

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@FaeyUmbrea FaeyUmbrea requested review from a team and aeneasr as code owners July 6, 2025 02:20
@FaeyUmbrea FaeyUmbrea changed the title Update token on login feat: Update token on login Jul 6, 2025
@FaeyUmbrea FaeyUmbrea changed the title feat: Update token on login feat: Update token on login (rebase) Jul 6, 2025
@FaeyUmbrea FaeyUmbrea changed the title feat: Update token on login (rebase) feat: update token on login (rebase) Jul 6, 2025
@FaeyUmbrea FaeyUmbrea force-pushed the update-token-on-login branch from 76cb1b8 to 350d3f1 Compare July 6, 2025 02:50
@FaeyUmbrea
Copy link
Author

@aeneasr tests that have been passing on main are passing and I've given it my best shot to implement your suggestions given in #2428 (comment)

A couple of them the original contributor already got to, I've taken it upon myself to introduce a per-provider feature flag.

There's an E2E test that checks if this functionality is working but no unit test. In the case we need one, I'd greatly appreciate some input what tests exactly should be added. I have broken the token update logic into its own function to facilitate unit tests more easily though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants