0.2.0.0
This commit is contained in:
+15
@@ -30,6 +30,21 @@ export const authOptions: NextAuthOptions = {
|
||||
throw new Error("密码错误")
|
||||
}
|
||||
|
||||
// 检查用户是否被停用
|
||||
if (!user.isActive) {
|
||||
throw new Error("账户已被停用,请联系管理员")
|
||||
}
|
||||
|
||||
// 记录登录日志
|
||||
await prisma.loginLog.create({
|
||||
data: {
|
||||
userId: user.id,
|
||||
email: user.email,
|
||||
userName: user.name,
|
||||
success: true,
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
|
||||
Reference in New Issue
Block a user