User authentication in Astro?
What ways are there to do user authentication within Astro, similar to NextAuth? I have found a package (Astro-Auth) that seems similar, but also seems like it hasn't been worked on for a while and the docs appear to be a little scattered. The goal was to do something similar to Auth.js's Email provider with the magic email links to sign people in. Does any information exist on doing something like that in Astro?
3 Replies
I joined the discord in search of an answer to a very similar question and for me this package ended up being the solution https://www.npmjs.com/package/auth-astro it brings what Astro-Auth supposedly brought but has been updated much more recently (~ a month ago) and worked for me, hope this helps you or whoever wanders here for the same reason <:ChillBar_cheer:866556305640914945>
npm
auth-astro
Auth Astro is the Auth.js implementation for Astro by Astro´s community.. Latest version: 1.0.5, last published: a month ago. Start using auth-astro in your project by running
npm i auth-astro
. There are no other projects in the npm registry using auth-astro.A month later but maybe you can help, were you able to use a database as well with this solution? I can’t seem to get a database adapter to work but I don’t know what’s causing it
Lol I forgot I posted this question
couldn't find an adapter for planetscale so I sort of hacked something together using event and callback functions