-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Milestone
Description
Most authentication plugins (https://github.com/simonw/datasette-auth-github for example) are likely to work by setting the ds_actor signed cookie, which is already magically decoded and supported by default Datasette here:
datasette/datasette/actor_auth_cookie.py
Lines 1 to 13 in 4fa7cf6
| from datasette import hookimpl | |
| from itsdangerous import BadSignature | |
| from http.cookies import SimpleCookie | |
| @hookimpl | |
| def actor_from_request(datasette, request): | |
| if "ds_actor" not in request.cookies: | |
| return None | |
| try: | |
| return datasette.unsign(request.cookies["ds_actor"], "actor") | |
| except BadSignature: | |
| return None |
I should document this.
Reactions are currently unavailable