Replies: 3 comments 8 replies
-
We don't use cookies for our auth, so that shouldn't be the problem. Do you have some code to share or some error you're getting that can help us debug this? |
Beta Was this translation helpful? Give feedback.
-
I would really love to know how to handle this as well. I'm completely new to both Nhost and Remix but have been working with a lot of different platforms such as supabase and firebase in the past. What does nhost.auth.signIn result in? Where do you store the JWT normally? Local storage? Would be nice to be able to alter this behaviour. |
Beta Was this translation helpful? Give feedback.
-
I've been trying to get auth to work server side for a whole day now, and has not moved an inch. I've started to understand the inner working of the auth flow a bit, but that's about it. I guess you guys haven't implemented anything (yet) to help with server side auth?One clue that makes me believe this is true is the callback URL:
The refreshToken is only readable from the client, the server has no clue of what's going on here, if I'm not misstaken. Is it even possible to use Nhost auth server side? If so, could anyone give any pointer on how to do this? My implementation looks kind of similar to what @st3phan posted above. I've even tried doing: export const loader: LoaderFunction = async ({ request }) => {´
return new Promise((resolve, reject) => {
const unsubsribe = nhostClient.auth.onAuthStateChanged(
(event: AuthChangeEvent, session: Session | null) => {
resolve(session)
}
)
// Timeout
setInterval(() => {
unsubsribe()
resolve(nhostClient.auth.getSession())
}, 1000)
})
} The event callback passed to With the rise of SSR, getting auth to work server side is kind of a big deal. Let me add that I'm trying to implement authentication using the magic email sign in. Also, I really love what you guys are doing here, this is not critisism in any way. Jus trying to make a living like the rest of the undead. |
Beta Was this translation helpful? Give feedback.
-
Is making auth v2 work on the serverside on the roadmap?
Looks like logging in on the serverside doesn't set a cookie so logging in actually logs in all connected clients to the same user.
I found out about this while trying Remix Run and I would love to use it together with Nhost.
Beta Was this translation helpful? Give feedback.
All reactions