teamhanko / hanko

Authentication and user management for the passkey era.
https://hanko.io
Other
5.67k stars 794 forks source link

refactor: profile endpoint session validation #1524

Closed lfleischmann closed 1 month ago

lfleischmann commented 1 month ago

Description

The sesssion middleware responses returned when invalid session tokens are provided has a different structure than other flow API error responses. We should try to make the responses consistent.

Implementation

The "old" session middleware is no longer applied to the profile endpoint. A private method on the handler now validates the session. The method's implementation is basically a copy of the echo-jwt implementation (see here).