Add loggin
This commit is contained in:
parent
5c93d1fcf7
commit
bd57671369
|
|
@ -81,7 +81,7 @@ void main({bool isTesting = false}) async {
|
|||
..addAll(createStoreGroupsMiddleware())
|
||||
..addAll(createStorePersistenceMiddleware())
|
||||
//..addAll(isTesting || kReleaseMode
|
||||
..addAll(isTesting
|
||||
..addAll(isTesting // TODO remove this
|
||||
? []
|
||||
: [
|
||||
LoggingMiddleware<dynamic>.printer(
|
||||
|
|
|
|||
|
|
@ -811,7 +811,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
|||
'\nis Large: ${(company?.isLarge ?? false) ? 'Yes' : 'No'}'
|
||||
'\nCompany: $companyUpdated${userCompanyState.isStale ? ' [S]' : ''}'
|
||||
'\nStatic: $staticUpdated${staticState.isStale ? ' [S]' : ''}'
|
||||
'\nPassword $passwordUpdated${authState.hasRecentlyEnteredPassword ? '' : ' [S]'}'
|
||||
'\nPassword: $passwordUpdated${authState.hasRecentlyEnteredPassword ? '' : ' [S]'}'
|
||||
'\n';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,12 @@ void passwordCallback({
|
|||
bool alwaysRequire = false,
|
||||
}) {
|
||||
final state = StoreProvider.of<AppState>(context).state;
|
||||
print(
|
||||
'## hasRecentlyEnteredPassword: ${state.authState.hasRecentlyEnteredPassword}');
|
||||
print('## oauthProvider.isNotEmpty: ${state.user.oauthProvider.isNotEmpty}');
|
||||
print(
|
||||
'## company.oauthPasswordRequired: ${state.company.oauthPasswordRequired}');
|
||||
|
||||
if (state.authState.hasRecentlyEnteredPassword && !alwaysRequire) {
|
||||
callback(null, null);
|
||||
} else {
|
||||
|
|
@ -125,7 +131,7 @@ void passwordCallback({
|
|||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}, isSilent: true);
|
||||
} else {
|
||||
showDialog<AlertDialog>(
|
||||
context: context,
|
||||
|
|
|
|||
|
|
@ -9,8 +9,11 @@ final GoogleSignIn _googleSignIn = GoogleSignIn(
|
|||
],
|
||||
);
|
||||
|
||||
void googleSignIn(Function(String, String, String) callback) async {
|
||||
final account = await _googleSignIn.signIn();
|
||||
void googleSignIn(Function(String, String, String) callback,
|
||||
{bool isSilent = false}) async {
|
||||
final account = await (isSilent
|
||||
? _googleSignIn.signInSilently()
|
||||
: _googleSignIn.signIn());
|
||||
if (account != null) {
|
||||
account.authentication.then((GoogleSignInAuthentication value) {
|
||||
callback(value.idToken, value.accessToken, value.serverAuthCode);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
void googleSignIn(Function(String, String, String) callback) async {}
|
||||
void googleSignIn(Function(String, String, String) callback, {bool isSilent = false}) async {}
|
||||
|
||||
void googleSignUp(Function(String, String, String) callback) async {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue