File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,18 @@ class _LoginPageState extends State<LoginPage> {
56
56
});
57
57
}
58
58
},
59
- onPageFinished: (url) {
59
+ onPageFinished: (url) async {
60
60
String authority = Uri .parse (url).authority;
61
61
if (authority == AUTHORITY ) {
62
- context.read <AuthModel >().authenticate ('https://$AUTHORITY ' );
62
+ try {
63
+ context.read <AuthModel >().authenticate ('https://$AUTHORITY ' );
64
+ } catch (e) {
65
+ setState (() {
66
+ _isVisible = true ;
67
+ });
68
+ await controller
69
+ .loadRequest (Uri .https (AUTHORITY , '/session/login/' , query));
70
+ }
63
71
} else if (authority == 'sparcssso.kaist.ac.kr' ) {
64
72
setState (() {
65
73
_isVisible = true ;
Original file line number Diff line number Diff line change @@ -7,14 +7,16 @@ class AuthModel extends ChangeNotifier {
7
7
bool get isLogined => _isLogined;
8
8
9
9
Future <void > authenticate (String url) async {
10
+ final cookieManager = WebviewCookieManager ();
10
11
try {
11
- final cookieManager = WebviewCookieManager ();
12
12
final cookies = await cookieManager.getCookies (url);
13
13
DioProvider ().authenticate (cookies);
14
14
_isLogined = true ;
15
15
notifyListeners ();
16
16
} catch (exception) {
17
17
print (exception);
18
+ await cookieManager.clearCookies ();
19
+ throw exception;
18
20
}
19
21
}
20
22
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ description: Online Timeplanner with Lectures Plus App @ KAIST
11
11
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12
12
# Read more about iOS versioning at
13
13
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14
- version : 2.5.1+21
14
+ version : 2.5.2+22
15
15
16
16
environment :
17
17
sdk : " >=3.2.0 <4.0.0"
You can’t perform that action at this time.
0 commit comments