I am using TypeScript, Appwrite, and Next.js to build an app. I want to authenticate and authorize users. I have two functions in ./lib/appwrite.ts These functions are login() and getCurrentUser().
In the login function I rely on account.createEmailPasswordSession and redirect to the appropriate protected route. In the appropriate protected route I invoke getCurrentUser() to get the logged in user then redirect to login route if the user is null or remain.
Unfortunately, the getCurrentUser() is always returning null and keeps redirecting back to the login route.
Here is my code for assistance.
Recommended threads
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- How to Display File in Web?
I'm trying to use Appwrite's Storage to store images and display them in my app, however when I use the `getFileView`, `getFileDownload` or `getFilePreview` met...