forked from firka/student-legacy
fixed nonce login error
This commit is contained in:
parent
d929c804df
commit
ce1c5eb0d8
@ -49,10 +49,16 @@ Future loginApi({
|
|||||||
}) async {
|
}) async {
|
||||||
Provider.of<KretaClient>(context, listen: false).userAgent =
|
Provider.of<KretaClient>(context, listen: false).userAgent =
|
||||||
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
Provider.of<SettingsProvider>(context, listen: false).config.userAgent;
|
||||||
|
|
||||||
Map<String, String> headers = {
|
Map<String, String> headers = {
|
||||||
"content-type": "application/x-www-form-urlencoded",
|
"content-type": "application/x-www-form-urlencoded",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
|
||||||
|
.getAPI(KretaAPI.nonce, json: false);
|
||||||
|
|
||||||
|
Nonce nonce = getNonce(nonceStr, username, instituteCode);
|
||||||
|
headers.addAll(nonce.header());
|
||||||
|
|
||||||
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
Map? res = await Provider.of<KretaClient>(context, listen: false)
|
||||||
.postAPI(KretaAPI.login,
|
.postAPI(KretaAPI.login,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user