Adjust password code
This commit is contained in:
parent
3552cc53ea
commit
65cde459d7
|
|
@ -168,15 +168,11 @@ void passwordCallback({
|
||||||
@required BuildContext context,
|
@required BuildContext context,
|
||||||
@required Function(String, String) callback,
|
@required Function(String, String) callback,
|
||||||
bool alwaysRequire = false,
|
bool alwaysRequire = false,
|
||||||
bool skipOAuth = false,
|
|
||||||
}) {
|
}) {
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
|
final skipOAuth = state.user.oauthProvider.isEmpty;
|
||||||
if (state.user.oauthProvider.isEmpty) {
|
|
||||||
skipOAuth = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alwaysRequire && !state.user.hasPassword) {
|
if (alwaysRequire && !state.user.hasPassword) {
|
||||||
showMessageDialog(
|
showMessageDialog(
|
||||||
|
|
@ -196,9 +192,6 @@ void passwordCallback({
|
||||||
if (state.hasRecentlyEnteredPassword && !alwaysRequire) {
|
if (state.hasRecentlyEnteredPassword && !alwaysRequire) {
|
||||||
callback(null, null);
|
callback(null, null);
|
||||||
return;
|
return;
|
||||||
} else if (!state.user.hasPassword && skipOAuth) {
|
|
||||||
callback(null, null);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skipOAuth) {
|
if (skipOAuth) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue