feat: 配置 NextAuth.js 认证系统
- 支持邮箱密码登录 - 支持 Magic Link 登录(Resend) - 配置 Session Provider - 添加 TypeScript 类型定义
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
import { DefaultSession } from 'next-auth';
|
||||
|
||||
declare module 'next-auth' {
|
||||
interface Session {
|
||||
user: {
|
||||
id: string;
|
||||
role: string;
|
||||
} & DefaultSession['user'];
|
||||
}
|
||||
|
||||
interface User {
|
||||
role: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'next-auth/jwt' {
|
||||
interface JWT {
|
||||
id: string;
|
||||
role: string;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user