Support password-less login with WebAuthn (#5112)
* Support password-less login with WebAuthn * Fix initial value of usePasswordLessLogin
This commit is contained in:
parent
e97dd13e81
commit
047a46d966
8 changed files with 90 additions and 10 deletions
21
src/server/api/endpoints/i/2fa/password-less.ts
Normal file
21
src/server/api/endpoints/i/2fa/password-less.ts
Normal 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
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue