Skip to content

keycloak.updateToken(50) The token is not refreshing the first time. #93

Open
@RaviDhakadDoodle

Description

@RaviDhakadDoodle

keycloak.updateToken(50)

I want to refresh the token every minute. So I have added code :-
keycloak.onTokenExpired = () => { keycloak.updateToken(50) .then((refreshed) => { if (refreshed && keycloak.token) { console.log('Token refreshed'); } }) .catch(() => { Alert. alert('Failed to refresh the token, or the session has expired.'); });

But it's not working as expected. For example, I have a token expiration time of 1 minute so it will call after 1 * 2 = 2 minutes only for the first time after that it works every minute.

To Reproduce

Expected behavior

Screenshots

Smartphone

  • Device:
  • OS:
  • Version

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions