feat: New change password page with server capabilities check
This commit is contained in:
parent
3eaecf0783
commit
5847fe0546
7 changed files with 296 additions and 94 deletions
|
|
@ -23,42 +23,6 @@ class SettingsSecurity extends StatefulWidget {
|
|||
}
|
||||
|
||||
class SettingsSecurityController extends State<SettingsSecurity> {
|
||||
void changePasswordAccountAction() async {
|
||||
final input = await showTextInputDialog(
|
||||
useRootNavigator: false,
|
||||
context: context,
|
||||
title: L10n.of(context)!.changePassword,
|
||||
okLabel: L10n.of(context)!.ok,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
textFields: [
|
||||
DialogTextField(
|
||||
hintText: L10n.of(context)!.chooseAStrongPassword,
|
||||
obscureText: true,
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
),
|
||||
DialogTextField(
|
||||
hintText: L10n.of(context)!.repeatPassword,
|
||||
obscureText: true,
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
),
|
||||
],
|
||||
);
|
||||
if (input == null) return;
|
||||
final success = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => Matrix.of(context)
|
||||
.client
|
||||
.changePassword(input.last, oldPassword: input.first),
|
||||
);
|
||||
if (success.error == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(L10n.of(context)!.passwordHasBeenChanged)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void setAppLockAction() async {
|
||||
if (AppLock.of(context).isActive) {
|
||||
AppLock.of(context).showLockScreen();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue