Adjust password code

This commit is contained in:
Hillel Coren 2021-11-02 08:54:52 +02:00
parent 3552cc53ea
commit 65cde459d7
1 changed files with 1 additions and 8 deletions

View File

@ -168,15 +168,11 @@ void passwordCallback({
@required BuildContext context,
@required Function(String, String) callback,
bool alwaysRequire = false,
bool skipOAuth = false,
}) {
final store = StoreProvider.of<AppState>(context);
final state = store.state;
final localization = AppLocalization.of(context);
if (state.user.oauthProvider.isEmpty) {
skipOAuth = true;
}
final skipOAuth = state.user.oauthProvider.isEmpty;
if (alwaysRequire && !state.user.hasPassword) {
showMessageDialog(
@ -196,9 +192,6 @@ void passwordCallback({
if (state.hasRecentlyEnteredPassword && !alwaysRequire) {
callback(null, null);
return;
} else if (!state.user.hasPassword && skipOAuth) {
callback(null, null);
return;
}
if (skipOAuth) {