fixed some bugs

This commit is contained in:
Kima
2023-06-10 22:38:01 +02:00
parent 67aea46c06
commit 9cfa8296b8
26 changed files with 517 additions and 252 deletions

View File

@@ -57,14 +57,15 @@ Future loginApi({
String nonceStr = await Provider.of<KretaClient>(context, listen: false)
.getAPI(KretaAPI.nonce, json: false);
Nonce nonce = getNonce(nonceStr, username.replaceAll(' ', '') + ' ', instituteCode);
Nonce nonce =
getNonce(nonceStr, '${username.replaceAll(' ', '')} ', instituteCode);
headers.addAll(nonce.header());
Map? res = await Provider.of<KretaClient>(context, listen: false)
.postAPI(KretaAPI.login,
headers: headers,
body: User.loginBody(
username: username.replaceAll(' ', '') + ' ',
username: '${username.replaceAll(' ', '')} ',
password: password,
instituteCode: instituteCode,
));
@@ -83,7 +84,7 @@ Future loginApi({
.getAPI(KretaAPI.student(instituteCode));
Student student = Student.fromJson(studentJson!);
var user = User(
username: username.replaceAll(' ', '') + ' ',
username: '${username.replaceAll(' ', '')} ',
password: password,
instituteCode: instituteCode,
name: student.name,