mdouchement / standardfile

Yet Another Standardfile (standardnotes server) Implementation written in Golang
MIT License
79 stars 9 forks source link

Issue with session refresh #56

Closed mdouchement closed 2 years ago

mdouchement commented 3 years ago
Refreshing the session
Error: could not refresh session: Invalid login credentials.
mdouchement commented 2 years ago

StandardNotes behavior have changed.

mdouchement commented 2 years ago

Qccording to the doc: https://docs.standardnotes.com/specification/auth/#refreshing-tokens

mdouchement commented 2 years ago

Qccording to the doc, refresh token process have really changed:

POST /session/token/refresh HTTP/1.1
Host: sync.standardnotes.org
Authorization: Bearer <access token>

{
  "refresh_token": "R_xxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
}

200 OK
{
  "token": "xxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx",
  "session": {
    "refresh_expiration": 1583020800,
    "refresh_token": "xxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx",
  }
}

Source code client session management https://github.com/standardnotes/snjs/tree/master/packages/snjs/lib/Services/Session

valantur commented 2 years ago

thanks for staying on top of this!

mdouchement commented 2 years ago

Fixed 🎉