GIDSignIn.sharedInstance.restorePreviousSignIn is not working as expected
@camden-king đang làm issue này rồi.
Từ ngày 8/11/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
I've been using 'GoogleSignIn' version '4.1.1' for many years and didn't have any trouble.Recently I've updated to '7.0.0' because the older version does not support the Apple Silicon.Back on the '4.1.1' I've been using GIDSignIn.sharedInstance().signInSilently() to sign in the user that is already signed in.Then in the delegate method I was catching any kind of error.One of these errors is expired token.And on the older version everything was working perfect as a swiss watch while the newest version seems to have some troubles with catching errors on time.If I use '4.1.1' and I force sign out a Google account session with an app using this library everything works perfect, the delegate method handles immediately an error after the first GIDSignIn.sharedInstance().signInSilently() attempt, while the newest version where I'm forced to use this method:
GIDSignIn.sharedInstance.restorePreviousSignIn { user, error in
if error != nil || user == nil {
self.service.authorizer = nil
} else {
self.service.authorizer = user?.fetcherAuthorizer
}
}
does not catch any kind of error and returns user without error as if everything is okay and no force sign out was done which leads to a bad user experience because app acts like if user is signed in, while actually not.The most interesting part is that after about 1 hour this method starts returning error saying "expired token", but again after waiting one hour.Does this method really supposed to give me an error about expired token after one hour and if so how to detect this error immediately without waiting so much time?
To Reproduce
Steps to reproduce the behavior:
- Sign in inside your app.
- Force sign out your app session from Devices section in the Security tab of your Google account settings.
- Restart the app, the app will act like the token is not expired, unable to show you any kind of data.
- Wait 1 hour but don't push Sign Out button in the app, just wait, after 1 hour
restorePreviousSignInmethod will return the error so the app will act like it should.
Even the test app has this issue, if you will sign out like in the step 2 and you will restart the test app it will show you that you are signed in...
Expected behavior
I guess giving me the error immediately like the sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) method does in the version '4.1.1' without giving to a user any kind of bad experience.
Environment
- Device: [ iPhone XS Max]
- OS: [iOS 17.0 ]
- Pod version: [ 7.0.0]
- Ngôn ngữ chính
- Objective-C
- Star
- 751
- Fork
- 282
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 11
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/GoogleSignIn-iOS
-
enhancement triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
google/GoogleSignIn-iOS#621 ·
-
enhancement triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
google/GoogleSignIn-iOS#620 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
google/GoogleSignIn-iOS#440 · 4 bình luận · 2 reaction ·
-
enhancement triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
google/GoogleSignIn-iOS#611 ·
-
Remove Cocoapods Support Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
google/GoogleSignIn-iOS#607 ·
Tất cả issue của google/GoogleSignIn-iOS
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
objective-see/LuLu#925 ·
-
macOS下查找brew::ncurse失败 Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
obsproject/obs-studio#13918 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
HigherOrderCO/Bend#842 · 2 bình luận ·