
Hello there,
I'm working on a vue+nuxt web app and I can't handle the authentication. I have a couple of issues:
- The documentation for the SSR auth for nuxt is not working (the part where it is written
useEvents
. So I wanted to log in with vue but when the page refreshes the user is logged out. I tried to useaccount.getSession('current')
and alsoconst session = await account.get()
but it gets the user with a delay Also I receive this warning in the consoleThird-party cookie will be blocked. Learn more in the Issues tab
. I have to mention I created a user store with pinia and I don't know if this is the right way to do so or if I should create a file in utils or a composable. - I couldn't find a good explanation about how to implement sign in with google or apple. I appreciate if you have a demo or you know a doc or post about it.
Here is the store I created:
export const useUserStore = defineStore('user', () => {
const { account } = useAppwrite()
const currentUser = ref(null)
const error = ref(null)
async function init() {
try {
// const { user } = await account.getSession('current')
const user = await account.get()
if (user)
currentUser.value = user
}
catch (err) {
error.value = `Failed to fetch current session: ${err.message}`
throw err
}
}
init()
// other functions for signup, login and logout
})
Additionally, I always receive this error and I found no solution for that
[unhandledRejection] User (role: guests) missing scope (account)```
Ultimately, I'd appreciate it if you can help me about the structure of how to use appwrite with vue+nuxt. what stuff I should do client side and what server side.
Thanks in advance

Are you on Cloud or Self-hosted?

Cloud

Cloud is currently on Appwrite 1.4. SSR is only available from Appwrite 1.5

As for Google sign in, see if this helps? https://youtu.be/tgO_ADSvY1I

Thanks, I watched it today and fixed this problem. But I still get this error either with email login or Google login
[unhandledRejection] User (role: guests) missing scope (account)

So that error means you’re not logged in. Assuming the Google login completed successfully, this probably means you’ll need to use a Custom Domain
Recommended threads
- CORS error using Appwrite DNS
Hello 👋 , we are using the DNS on organization domains `rostlino.cz` using nameservers `NS` ``` NAME: rostlino.cz TYPE: NS VALUE: ns1.appwrite.zone TTL: 3360 ...
- [AppwriteException: The current user is ...
i get this error when i try to create a document in my react native app, even tho permissions for db are set to any, and the document is created in the db despi...
- Duplicate name types with multiple datab...
Hello, we are having multiple databases and would like to use the cli to generate the types using (appwrite types --language ts), the issue is that the appwrit...
