feat: deliver RSchedule service login exams and elastic glass navigation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'school_navigation_policy.dart';
|
||||
|
||||
/// Only the authenticated graduate system may advance the service handshake.
|
||||
class SchoolLoginFlow {
|
||||
Uri? _target;
|
||||
bool _requested = false;
|
||||
void begin(Uri target) {
|
||||
_target = target;
|
||||
_requested = false;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_target = null;
|
||||
_requested = false;
|
||||
}
|
||||
|
||||
Uri? onLoaded(Uri uri, {required bool authenticated}) {
|
||||
if (_target == null || !SchoolNavigationPolicy.isSchoolPage(uri)) {
|
||||
return null;
|
||||
}
|
||||
if (uri.host == 'idas.uestc.edu.cn') {
|
||||
_requested = false;
|
||||
return null;
|
||||
}
|
||||
if (uri.path == _target!.path ||
|
||||
_requested ||
|
||||
!authenticated ||
|
||||
!uri.path.startsWith('/pyxx/')) {
|
||||
return null;
|
||||
}
|
||||
_requested = true;
|
||||
return _target;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user