introduce an authentication service and prepare user management

This commit is contained in:
Sven Czarnian
2022-11-03 01:30:27 +01:00
parent ce17a29f7c
commit 58b98456ac
5 changed files with 144 additions and 49 deletions

View File

@@ -0,0 +1,44 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
export type UserDocument = User & Document;
@Schema()
export class User {
@Prop({
required: true,
index: true,
type: String,
})
vatsimId: string;
@Prop({
type: String,
})
fullName: string;
@Prop({
required: true,
type: String,
})
vatsimToken: string;
@Prop({
type: String,
})
vatsimRefreshToken: string;
@Prop({
type: Boolean,
default: false,
})
administrator: boolean;
@Prop({
type: [String],
default: [],
})
airportConfigurationAccess: string[];
}
export const UserSchema = SchemaFactory.createForClass(User);