forked from firka/student-legacy
login fix
This commit is contained in:
parent
d93dce7857
commit
4474562538
@ -33,35 +33,71 @@ class _KretenLoginWidgetState extends State<KretenLoginWidget>
|
|||||||
controller = WebViewController()
|
controller = WebViewController()
|
||||||
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
..setJavaScriptMode(JavaScriptMode.unrestricted)
|
||||||
..setNavigationDelegate(NavigationDelegate(
|
..setNavigationDelegate(NavigationDelegate(
|
||||||
onPageStarted: (url) async {
|
onNavigationRequest: (n) async {
|
||||||
setState(() {
|
if (n.url.startsWith('https://mobil.e-kreta.hu')) {
|
||||||
loadingPercentage = 0;
|
setState(() {
|
||||||
currentUrl = url;
|
loadingPercentage = 0;
|
||||||
});
|
currentUrl = n.url;
|
||||||
|
});
|
||||||
|
|
||||||
// final String instituteCode = widget.selectedSchool;
|
// final String instituteCode = widget.selectedSchool;
|
||||||
if (!url.startsWith(
|
// if (!n.url.startsWith(
|
||||||
'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=')) {
|
// 'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=')) {
|
||||||
return;
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<String> requiredThings = n.url
|
||||||
|
.replaceAll(
|
||||||
|
'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=',
|
||||||
|
'')
|
||||||
|
.replaceAll(
|
||||||
|
'&scope=openid%20email%20offline_access%20kreta-ellenorzo-webapi.public%20kreta-eugyintezes-webapi.public%20kreta-fileservice-webapi.public%20kreta-mobile-global-webapi.public%20kreta-dkt-webapi.public%20kreta-ier-webapi.public&state=refilc_student_mobile&session_state=',
|
||||||
|
':')
|
||||||
|
.split(':');
|
||||||
|
|
||||||
|
String code = requiredThings[0];
|
||||||
|
// String sessionState = requiredThings[1];
|
||||||
|
|
||||||
|
widget.onLogin(code);
|
||||||
|
// Future.delayed(const Duration(milliseconds: 500), () {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// });
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
|
||||||
|
return NavigationDecision.prevent;
|
||||||
|
} else {
|
||||||
|
return NavigationDecision.navigate;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
List<String> requiredThings = url
|
onPageStarted: (url) async {
|
||||||
.replaceAll(
|
// setState(() {
|
||||||
'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=',
|
// loadingPercentage = 0;
|
||||||
'')
|
// currentUrl = url;
|
||||||
.replaceAll(
|
|
||||||
'&scope=openid%20email%20offline_access%20kreta-ellenorzo-webapi.public%20kreta-eugyintezes-webapi.public%20kreta-fileservice-webapi.public%20kreta-mobile-global-webapi.public%20kreta-dkt-webapi.public%20kreta-ier-webapi.public&state=refilc_student_mobile&session_state=',
|
|
||||||
':')
|
|
||||||
.split(':');
|
|
||||||
|
|
||||||
String code = requiredThings[0];
|
|
||||||
// String sessionState = requiredThings[1];
|
|
||||||
|
|
||||||
widget.onLogin(code);
|
|
||||||
// Future.delayed(const Duration(milliseconds: 500), () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// });
|
// });
|
||||||
// Navigator.of(context).pop();
|
|
||||||
|
// // final String instituteCode = widget.selectedSchool;
|
||||||
|
// if (!url.startsWith(
|
||||||
|
// 'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=')) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// List<String> requiredThings = url
|
||||||
|
// .replaceAll(
|
||||||
|
// 'https://mobil.e-kreta.hu/ellenorzo-student/prod/oauthredirect?code=',
|
||||||
|
// '')
|
||||||
|
// .replaceAll(
|
||||||
|
// '&scope=openid%20email%20offline_access%20kreta-ellenorzo-webapi.public%20kreta-eugyintezes-webapi.public%20kreta-fileservice-webapi.public%20kreta-mobile-global-webapi.public%20kreta-dkt-webapi.public%20kreta-ier-webapi.public&state=refilc_student_mobile&session_state=',
|
||||||
|
// ':')
|
||||||
|
// .split(':');
|
||||||
|
|
||||||
|
// String code = requiredThings[0];
|
||||||
|
// // String sessionState = requiredThings[1];
|
||||||
|
|
||||||
|
// widget.onLogin(code);
|
||||||
|
// // Future.delayed(const Duration(milliseconds: 500), () {
|
||||||
|
// // Navigator.of(context).pop();
|
||||||
|
// // });
|
||||||
|
// // Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
onProgress: (progress) {
|
onProgress: (progress) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user