Support password-less login with WebAuthn (#5112)
* Support password-less login with WebAuthn * Fix initial value of usePasswordLessLogin
This commit is contained in:
		
							
								
								
									
										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 | ||||
| 	}); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user
	 Satsuki Yanagi
					Satsuki Yanagi