Rank 2: Process
I'm working my way through a basic CRUD app. So far it's been a great experience. I implemented a registration route and a login route. I registered and logged in. I continued to code and test and life was good.
Later on I logged out and now I can't log in again. I'm now left wondering how I ever managed to authenticate in the first place.
https://github.com/lost-RD/HTMXxAppwrite-Todo/
register(): https://github.com/lost-RD/HTMXxAppwrite-Todo/blob/main/main.py#L190
login(): https://github.com/lost-RD/HTMXxAppwrite-Todo/blob/main/main.py#L219
logout(): https://github.com/lost-RD/HTMXxAppwrite-Todo/blob/main/main.py#L242
I'm pretty sure the code here is in the state it was when I logged in that one time, but I could be wrong (since it doesn't work now).
Account doesn't seem to be a scope for an API token, which suggests it's a client-side role and all auth happens on the client side. So how did I ever log in in the first place? Is there something about the registration code there that enables a login to work without client-side auth?
This is the result of trying to use the /logout route:
web-1 | requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://fra.cloud.appwrite.io/v1/account/sessions/current
...
web-1 | appwrite.exception.AppwriteException: app.*******@service.fra.cloud.appwrite.io (role: applications) missing scope (account)