Adding autobind decorator to server
This commit is contained in:
@@ -6,9 +6,10 @@ import crypto from 'crypto'
|
||||
import urlSafeBase64 from 'urlsafe-base64'
|
||||
import util from 'util'
|
||||
import * as loginToken from './loginToken'
|
||||
import autoBind from 'auto-bind2'
|
||||
import autobind from 'autobind-decorator'
|
||||
import url from 'url'
|
||||
|
||||
@autobind
|
||||
export class AuthRoutes {
|
||||
constructor(container) {
|
||||
const app = container.app
|
||||
@@ -20,7 +21,6 @@ export class AuthRoutes {
|
||||
this.sendEmailDelayInSeconds = config.get('email.sendEmailDelayInSeconds')
|
||||
this.supportEmail = config.get('email.supportEmail')
|
||||
this.sendEmail = config.get('email.sendEmail')
|
||||
autoBind(this)
|
||||
app.route('/auth/login')
|
||||
// Used to login. Email must be confirmed.
|
||||
.post(this.login)
|
||||
@@ -194,7 +194,7 @@ export class AuthRoutes {
|
||||
if (this.sendEmail) {
|
||||
await this.mq.request('dar-email', 'sendEmail', msgs)
|
||||
}
|
||||
|
||||
|
||||
res.json({})
|
||||
} catch(err) {
|
||||
if (err instanceof createError.HttpError) {
|
||||
|
||||
Reference in New Issue
Block a user