Code formatting and cleanup
This commit is contained in:
parent
25f890e082
commit
b84c2cdff1
@ -8,7 +8,6 @@ import {MailTemplate} from "../../Mail";
|
||||
import {AuthError, PendingApprovalAuthError, RegisterCallback} from "../AuthGuard";
|
||||
import geoip from "geoip-lite";
|
||||
import AuthController from "../AuthController";
|
||||
import NunjucksComponent from "../../components/NunjucksComponent";
|
||||
import RedirectBackComponent from "../../components/RedirectBackComponent";
|
||||
|
||||
|
||||
|
@ -6,7 +6,6 @@ import Throttler from "../../Throttler";
|
||||
import Mail, {MailTemplate} from "../../Mail";
|
||||
import MagicLink from "../models/MagicLink";
|
||||
import config from "config";
|
||||
import ModelFactory from "../../db/ModelFactory";
|
||||
|
||||
export default abstract class MagicLinkController extends Controller {
|
||||
public static async sendMagicLink(sessionID: string, actionType: string, original_url: string, email: string, mailTemplate: MailTemplate, data: object): Promise<void> {
|
||||
|
@ -6,7 +6,6 @@ import User from "./User";
|
||||
import argon2 from "argon2";
|
||||
import {WhereTest} from "../../db/ModelQuery";
|
||||
import UserEmail from "./UserEmail";
|
||||
import ModelFactory from "../../db/ModelFactory";
|
||||
import {EMAIL_REGEX} from "../../db/Validator";
|
||||
|
||||
export default class MagicLink extends Model implements AuthProof<User> {
|
||||
@ -35,10 +34,6 @@ export default class MagicLink extends Model implements AuthProof<User> {
|
||||
private generated_at?: Date = undefined;
|
||||
private authorized: boolean = false;
|
||||
|
||||
constructor(factory: ModelFactory<MagicLink>) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
protected init(): void {
|
||||
this.setValidation('session_id').defined().length(32).unique(this);
|
||||
this.setValidation('email').defined().regexp(EMAIL_REGEX);
|
||||
|
@ -25,10 +25,6 @@ export default class User extends Model {
|
||||
|
||||
public readonly mainEmail = this.emails.cloneReduceToOne().constraint(q => q.where('id', this.main_email_id));
|
||||
|
||||
public constructor(factory: ModelFactory<User>) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
protected init(): void {
|
||||
this.setValidation('name').acceptUndefined().between(3, 64);
|
||||
this.setValidation('main_email_id').acceptUndefined().exists(UserEmail, 'id');
|
||||
|
@ -15,10 +15,6 @@ export default class UserEmail extends Model {
|
||||
foreignKey: 'id'
|
||||
});
|
||||
|
||||
constructor(factory: ModelFactory<UserEmail>) {
|
||||
super(factory);
|
||||
}
|
||||
|
||||
protected init(): void {
|
||||
this.setValidation('user_id').acceptUndefined().exists(User, 'id');
|
||||
this.setValidation('email').defined().regexp(EMAIL_REGEX).unique(this);
|
||||
|
Loading…
Reference in New Issue
Block a user