TF-624 Reload page when logged oidc

This commit is contained in:
dab246
2022-06-08 19:12:29 +07:00
committed by Dat H. Pham
parent 5b66383eb3
commit 0dd387365a
6 changed files with 82 additions and 23 deletions
@@ -78,20 +78,14 @@ class LoginController extends GetxController {
? Password(password.trim())
: null;
@override
void onInit() {
if (BuildUtils.isWeb) {
_getAuthenticationInfo();
}
super.onInit();
}
@override
void onReady() {
if (BuildUtils.isWeb) {
final arguments = Get.arguments;
if (arguments is LoginArguments) {
loginFormType.value = arguments.loginFormType;
} else {
_getAuthenticationInfo();
}
}
super.onReady();
@@ -100,10 +94,12 @@ class LoginController extends GetxController {
void _getAuthenticationInfo() async {
await _getAuthenticationInfoInteractor.execute()
.then((result) => result.fold(
(failure) => {},
(failure) => _checkOIDCIsAvailable(),
(success) {
if (success is GetAuthenticationInfoSuccess) {
_getStoredOidcConfiguration();
} else {
_checkOIDCIsAvailable();
}
}));
}