Skip to content

Emit token_expires if token has already expired #637

Closed
@coltonneil

Description

@coltonneil

Current behavior:
A new visitor comes to my site, I configure OAuthService and get an access token. After a certain amount of time decided by my timeoutFactor OAuthService emits 'token_expires'. (as intended)

A visitor comes BACK to my site after some time and their token has already passed the timeoutFactor (but is not yet expired). OAuthService does not emit 'token_expires'.

Suggested solution:
When an access token exists OAuthService checks that tokens expiration against the timeoutFactor as part of it's initialization. If the token has already passed the timeout factor it emits 'token_expires'

Alternative:
Calling hasValidAccessToken() will emit 'token_expires' if the token has already passed the timeoutFactor (hasValidAccessToken still returns true/false based on existing logic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor tagging faulty or unexpected behavior.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions