role updated
This commit is contained in:
@@ -7,14 +7,11 @@ export interface Token extends Document {
|
|||||||
refreshToken: string;
|
refreshToken: string;
|
||||||
resetTokenExpiry?: Date;
|
resetTokenExpiry?: Date;
|
||||||
resetToken: string;
|
resetToken: string;
|
||||||
role: string;
|
|
||||||
}
|
}
|
||||||
const tokenSchema: Schema = new Schema({
|
const tokenSchema: Schema = new Schema({
|
||||||
userId: { type: Schema.Types.ObjectId, ref: "User" },
|
userId: { type: Schema.Types.ObjectId, ref: "User" },
|
||||||
isArchive: { type: Boolean, default: false },
|
isArchive: { type: Boolean, default: false },
|
||||||
token: { type: String },
|
|
||||||
refreshToken: { type: String },
|
refreshToken: { type: String },
|
||||||
tokenCreatedAt: { type: Date },
|
|
||||||
resetToken: { type: String },
|
resetToken: { type: String },
|
||||||
resetTokenExpiry: { type: Date },
|
resetTokenExpiry: { type: Date },
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,13 +6,15 @@ export interface User extends Document {
|
|||||||
Password: string;
|
Password: string;
|
||||||
isArchive: boolean;
|
isArchive: boolean;
|
||||||
visitorBrowserID: string;
|
visitorBrowserID: string;
|
||||||
|
role: string;
|
||||||
lastPasswordReset: number;
|
lastPasswordReset: number;
|
||||||
}
|
}
|
||||||
const AuthSchema: Schema = new Schema({
|
const AuthSchema: Schema = new Schema({
|
||||||
userName: {
|
userName: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},role: {
|
},
|
||||||
|
role: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "User",
|
default: "User",
|
||||||
enum: ["User", "Admin"],
|
enum: ["User", "Admin"],
|
||||||
|
|||||||
Reference in New Issue
Block a user