feat: Refine 2fa (#11766)
* wip
* Update 2fa.qrdialog.vue
* Update 2fa.vue
* Update CHANGELOG.md
* tweak
* ✌️
			
			
This commit is contained in:
		| @@ -54,8 +54,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- | ||||
| 				throw new Error('not verified'); | ||||
| 			} | ||||
|  | ||||
| 			const backupCodes = Array.from({ length: 5 }, () => new OTPAuth.Secret().base32); | ||||
|  | ||||
| 			await this.userProfilesRepository.update(me.id, { | ||||
| 				twoFactorSecret: profile.twoFactorTempSecret, | ||||
| 				twoFactorBackupSecret: backupCodes, | ||||
| 				twoFactorEnabled: true, | ||||
| 			}); | ||||
|  | ||||
| @@ -64,6 +67,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- | ||||
| 				detail: true, | ||||
| 				includeSecrets: true, | ||||
| 			})); | ||||
|  | ||||
| 			return { | ||||
| 				backupCodes: backupCodes, | ||||
| 			}; | ||||
| 		}); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -46,6 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- | ||||
|  | ||||
| 			await this.userProfilesRepository.update(me.id, { | ||||
| 				twoFactorSecret: null, | ||||
| 				twoFactorBackupSecret: null, | ||||
| 				twoFactorEnabled: false, | ||||
| 				usePasswordLessLogin: false, | ||||
| 			}); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo