Support password-less login with WebAuthn (#5112)

* Support password-less login with WebAuthn

* Fix initial value of usePasswordLessLogin
This commit is contained in:
Satsuki Yanagi
2019-07-07 01:38:36 +09:00
committed by syuilo
parent e97dd13e81
commit 047a46d966
8 changed files with 90 additions and 10 deletions

View File

@ -0,0 +1,21 @@
import $ from 'cafy';
import define from '../../../define';
import { UserProfiles } from '../../../../../models';
export const meta = {
requireCredential: true,
secure: true,
params: {
value: {
validator: $.boolean
}
}
};
export default define(meta, async (ps, user) => {
await UserProfiles.update(user.id, {
usePasswordLessLogin: ps.value
});
});