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

View File

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