mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement SignIn/SignOut
This commit is contained in:
parent
bce35d73ca
commit
adeb3fd3bf
16 changed files with 987 additions and 77 deletions
|
|
@ -18,7 +18,10 @@ export default defineConfig({
|
|||
async authorize(credentials) {
|
||||
if (!credentials?.username || !credentials.password) throw new InvalidLoginError()
|
||||
|
||||
const user = await prismaClient.users.findUnique({ where: { username: credentials.username } })
|
||||
const user = await prismaClient.users.findUnique({
|
||||
select: { username: true, password: true },
|
||||
where: { username: credentials.username }
|
||||
})
|
||||
if (!user) throw new InvalidLoginError()
|
||||
|
||||
const valid = await bcrypt.compare(credentials.password, user.password)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue