From ffaec0b9712df9a5024c0883a154442f02b72a03 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 28 Aug 2017 23:47:43 +0900 Subject: #497 --- src/api/private/signup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api/private') diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index 2375c22845..899fa88472 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -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({ -- cgit v1.2.3-freya