This repository has been archived on 2023-05-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
auth/lib/schema/strategy.ts
mifi 34acea15a2
Some checks failed
continuous-integration/drone/push Build is failing
- Linty fresh...
2023-05-02 02:04:09 -04:00

26 lines
596 B
TypeScript

import { InferSchemaType, Schema, Types } from 'mongoose';
import { STRATEGIES } from '../constants/strategies';
export const Strategy = new Schema(
{
method: {
type: Number,
enum: Object.values(STRATEGIES),
index: true,
required: true,
unique: true
},
externalId: { type: String, index: true },
key: { type: String, required: true, trim: true },
profile: {},
resetToken: { type: String },
forceReset: { type: Boolean }
},
{
minimize: true,
timestamps: true
}
);
export type Strategy = InferSchemaType<typeof Strategy>;