Socket connection now works

- Pairing a new device works

(I did a lot since the last commit)
This commit is contained in:
2021-11-14 01:42:21 +01:00
parent 28e85ea730
commit 19b7c05d75
72 changed files with 5861 additions and 23719 deletions

View File

@@ -4,11 +4,14 @@ import { IUser } from '../user/user.interface';
export interface IPhone extends Document {
androidId: String,
displayName: String,
modelName: String,
modelName: string,
operatingSystem: String,
architecture: String,
user: IUser,
active: Boolean,
approval: {
approvedOn?: Date,
code: String
},
updatedAt?: Date,
createdAt?: Date
}

View File

@@ -8,7 +8,10 @@ const schemaPhone = new Schema({
operatingSystem: { type: String, required: false },
architecture: { type: String, required: false },
user: { type: SchemaTypes.ObjectId, required: true },
active: { type: Boolean, required: true }
approval: {
approvedOn: { type: Date, required: false },
code: { type: String, required: true }
}
}, {
timestamps: {
createdAt: true,

View File

@@ -12,7 +12,5 @@ export interface IUser extends Document {
salt: string,
type: UserType,
lastLogin: Date,
twoFASecret?: string,
brokerToken: string,
createdAt?: Date
twoFASecret?: string
}

View File

@@ -6,7 +6,6 @@ const schemaUser = new Schema({
salt: { type: String, required: true },
type: { type: String, required: true, default: 'user' }, // This could be user, admin, guest
twoFASecret: { type: String, required: false },
brokerToken: { type: String, required: true },
lastLogin: { type: Date, required: true, default: Date.now },
}, {
timestamps: {