Hello there! So, I have a Nuxt 3 SSR app. I have a middleware for the "/" route that executes in process.server. This middleware uses the account.get() method to check the session of the user. If it doesn't exist any it redirects to the login page. This is working fine.
Then, I have my login page where I create the emailSession and then it redirects to the "/" route.
The thing is that if I reload in the "/" route, it redirects me again to the login page even if the session is already active on my appwrite console.
What am I doing wrong?
You might check this out.
https://github.com/Meldiron/appwrite-ssr-nuxt
I believe it's not working for you since it's rendered server side, unless you've passed along that auth information it have no idea that you've authenticated client side?
Thank you! I’ll take a look at it and will update result here
I think I get it
I think in the next release 1.5 they're planning some better SSR auth, and providing official examples. But not sure the time frame on when 1.5 will release.
So, I have to create a custom domain here... Right? What if I'm working in my local machine?
This is awesome
Still, I think I might just change the project to full client side rendering just to avoid some future situations?
You can update your hosts file to have something like
127.0.0.1 domain.com
then in your nuxt.config.js file
server: {
port: 3000,
host: 'http://domain.com',
}
Then you can access it by going to
domain.com:3000
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...