Rename
This commit is contained in:
parent
42d9ad4206
commit
9f28e5ef79
2 changed files with 7 additions and 8 deletions
|
@ -3,7 +3,6 @@ import "package:logging/logging.dart";
|
|||
import "package:photos/core/network/network.dart";
|
||||
import "package:photos/utils/dialog_util.dart";
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import "package:uuid/uuid.dart";
|
||||
|
||||
class PasskeyService {
|
||||
PasskeyService._privateConstructor();
|
||||
|
@ -18,11 +17,11 @@ class PasskeyService {
|
|||
return response.data!["accountsToken"] as String;
|
||||
}
|
||||
|
||||
Future<bool> isPassKeyRecoveryEnabled() async {
|
||||
Future<bool> isPasskeyRecoveryEnabled() async {
|
||||
final response = await _enteDio.get(
|
||||
"/users/two-factor/recovery-status",
|
||||
);
|
||||
return response.data!["isPassKeyRecoveryEnabled"] as bool;
|
||||
return response.data!["isPasskeyRecoveryEnabled"] as bool;
|
||||
}
|
||||
|
||||
Future<void> configurePasskeyRecovery(
|
||||
|
@ -31,7 +30,7 @@ class PasskeyService {
|
|||
String userSecretNonce,
|
||||
) async {
|
||||
await _enteDio.post(
|
||||
"/users/two-factor/passkeys/configure-reset",
|
||||
"/users/two-factor/passkeys/configure-recovery",
|
||||
data: {
|
||||
"secret": secret,
|
||||
"userSecretCipher": userEncryptedSecret,
|
||||
|
|
|
@ -114,7 +114,7 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||
pressedColor: getEnteColorScheme(context).fillFaint,
|
||||
trailingIcon: Icons.chevron_right_outlined,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async => await onPassKeyClick(context),
|
||||
onTap: () async => await onPasskeyClick(context),
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
MenuItemWidget(
|
||||
|
@ -236,14 +236,14 @@ class _SecuritySectionWidgetState extends State<SecuritySectionWidget> {
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> onPassKeyClick(BuildContext buildContext) async {
|
||||
Future<void> onPasskeyClick(BuildContext buildContext) async {
|
||||
try {
|
||||
final isPassKeyResetEnabled =
|
||||
await PasskeyService.instance.isPassKeyRecoveryEnabled();
|
||||
await PasskeyService.instance.isPasskeyRecoveryEnabled();
|
||||
if (!isPassKeyResetEnabled) {
|
||||
final Uint8List recoveryKey =
|
||||
await UserService.instance.getOrCreateRecoveryKey(context);
|
||||
final String resetSecret = const Uuid().v4().toString();
|
||||
final resetSecret = const Uuid().v4().toString();
|
||||
final bytes = utf8.encode(resetSecret);
|
||||
final base64Str = base64.encode(bytes);
|
||||
final encryptionResult = CryptoUtil.encryptSync(
|
||||
|
|
Loading…
Add table
Reference in a new issue