Skip to content

Explain usage of refreshToken #22

Open
@Bouni

Description

@Bouni

If I use the authToken mutation as explained in the README.
jwt_schema defines :

 type TokenAuth {
        token: String
        refresh_token: String
        payload: GenericScalar
    }

If I login, I receive this:

{
  "data": {
    "tokenAuth": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjQ3NjE1Nzk3LCJvcmlnSWF0IjoxNjQ3NjEyMTk3fQ.j5BQ-KhQeqwJv0hjMTYDP2D4Py1uIKcJpPlSeCR8qmg",
      "refresh_token": null,
      "payload": null
    }
  }
}

refresh_token and payload are always null ....

In an attempt to refresh the token, I tried the refreshToken mutation and passed my current token, which worked and got me this response:

{
  "data": {
    "refreshToken": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZXhwIjoxNjQ3NjE1OTA0LCJvcmlnSWF0IjoxNjQ3NjEyMTk3fQ.hwH4EruJ_21_XjmEb42VPpgpuzprWr29654OG-C1ELE",
      "refresh_token": null,
      "payload": {
        "username": "admin",
        "exp": 1647615904,
        "origIat": 1647612197
      }
    }
  }

Again, refresh_token is null as well

What's the idea behind those two? I expected to get a token and a refresh token as result of the tokenAuth mutation and that I need to use the refresh token with the refreshToken mutation in order to receive a new pair of tokens!?

Can you please bring some light into this?

Also I wonder how to logout a user? Simply delete the token on the client side?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions