added tons of features
This commit is contained in:
16
actions/auth/google-login.ts
Normal file
16
actions/auth/google-login.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
'use server'
|
||||
|
||||
import {AuthError} from 'next-auth'
|
||||
|
||||
import {signIn} from '@/auth'
|
||||
|
||||
export async function googleAuthenticate() {
|
||||
try {
|
||||
await signIn('google')
|
||||
} catch (error) {
|
||||
if (error instanceof AuthError) {
|
||||
return 'google log in failed'
|
||||
}
|
||||
throw error
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user