Add keypair to local account

This commit is contained in:
Akihiko Odaki
2018-03-26 20:23:55 +09:00
parent 7b0f93464a
commit 001d5faac9
10 changed files with 146 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import * as uuid from 'uuid';
import * as express from 'express';
import * as bcrypt from 'bcryptjs';
import { generate as generateKeypair } from '../../crypto_key';
import recaptcha = require('recaptcha-promise');
import User, { IUser, validateUsername, validatePassword, pack } from '../models/user';
import generateUserToken from '../common/generate-native-user-token';
@@ -119,6 +120,7 @@ export default async (req: express.Request, res: express.Response) => {
username: username,
username_lower: username.toLowerCase(),
account: {
keypair: generateKeypair(),
token: secret,
email: null,
links: null,