This commit is contained in:
@ -1,10 +1,10 @@
|
||||
import * as express from 'express';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import rndstr from 'rndstr';
|
||||
import recaptcha = require('recaptcha-promise');
|
||||
import User from '../models/user';
|
||||
import { validateUsername, validatePassword } from '../models/user';
|
||||
import serialize from '../serializers/user';
|
||||
import generateUserToken from '../common/generate-native-user-token';
|
||||
import config from '../../conf';
|
||||
|
||||
recaptcha.init({
|
||||
@ -58,7 +58,7 @@ export default async (req: express.Request, res: express.Response) => {
|
||||
const hash = bcrypt.hashSync(password, salt);
|
||||
|
||||
// Generate secret
|
||||
const secret = `!${rndstr('a-zA-Z0-9', 32)}`;
|
||||
const secret = generateUserToken();
|
||||
|
||||
// Create account
|
||||
const account = await User.insert({
|
||||
|
Reference in New Issue
Block a user