fixed nonce login error

This commit is contained in:
Márton Kiss 2023-06-15 09:33:36 +02:00 committed by GitHub
parent d929c804df
commit ce1c5eb0d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,12 @@ Future loginApi({
"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,
headers: headers, headers: headers,