refreshLogin method
Future
refreshLogin({
- dynamic inputConf,
- dynamic inputCredentials,
- dynamic scope,
- dynamic storeInfo = true,
Automatically redo the login
Implementation
Future refreshLogin({
inputConf,
inputCredentials,
scope,
storeInfo = true,
}) async {
final conf = inputConf ?? getConfiguration();
if (conf == null) {
throw 'Error during kc-refresh-login: '
'Could not read configuration from storage';
}
final credentials = inputCredentials ?? await getCredentials();
if (credentials == null) {
throw 'Error during kc-refresh-login: Could not read from AsyncStorage';
}
final username = credentials['username'];
final password = credentials['password'];
if (username == null || password == null) {
throw 'Error during kc-refresh-login: Username or Password not found';
}
_performLogin(conf, username, password, scope: scope, storeInfo: storeInfo);
}