This commit is contained in:
syuilo 2018-08-20 23:49:00 +09:00
parent a542765cf8
commit 2c9bacfcea
2 changed files with 5 additions and 4 deletions

View file

@ -53,8 +53,9 @@ export default Vue.extend({
this.signing = true; this.signing = true;
(this as any).api('signin', { (this as any).api('signin', {
username: this.username, // password ( username )
password: this.password, x: this.username,
y: this.password,
token: this.user && this.user.twoFactorEnabled ? this.token : undefined token: this.user && this.user.twoFactorEnabled ? this.token : undefined
}).then(() => { }).then(() => {
location.reload(); location.reload();

View file

@ -12,8 +12,8 @@ export default async (ctx: Koa.Context) => {
ctx.set('Access-Control-Allow-Credentials', 'true'); ctx.set('Access-Control-Allow-Credentials', 'true');
const body = ctx.request.body as any; const body = ctx.request.body as any;
const username = body['username']; const username = body['username'] || body['x'];
const password = body['password']; const password = body['password'] || body['y'];
const token = body['token']; const token = body['token'];
if (typeof username != 'string') { if (typeof username != 'string') {