Fakultas Ilmu Komputer UI

Verified Commit 57a8321b authored by Muhammad Ariq Basyar's avatar Muhammad Ariq Basyar
Browse files

[CHORE] fix login with google

parent 80e608c4
Pipeline #81263 passed with stages
in 17 minutes and 35 seconds
......@@ -225,6 +225,7 @@ class LoginState extends State<Login> {
}
Future<void> _updateUser(UpdateUserModel updateUserModel) async {
updateUserModel.foto = '';
final updatedUser = await _userBloc.updateUser(updateUserModel);
if (updatedUser != null) {
successUserUpdateDialog(context);
......@@ -349,23 +350,14 @@ class LoginState extends State<Login> {
}
Future<void> _handleSignIn() async {
try {
await _handleSignOut();
final googleSignInAccount = await _googleSignIn.signIn();
final googleSignInAuthentication =
await googleSignInAccount.authentication;
await _handleSignOut();
final googleSignInAccount = await _googleSignIn.signIn();
final googleSignInAuthentication =
await googleSignInAccount.authentication;
final token = googleSignInAuthentication.accessToken;
await login(
_currentUser.email, '', 'true', token, _currentUser.displayName);
sharedPreferences = await SharedPreferences.getInstance();
successDialog(context);
Timer(const Duration(seconds: 2), () {
Navigator.pushNamed(context, '/');
});
} catch (error) {
failedDialog(context);
}
final token = googleSignInAuthentication.accessToken;
await login(
_currentUser.email, '', 'true', token, _currentUser.displayName);
}
Future<void> _handleSignOut() async {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment