Removed " " from login

This commit is contained in:
Tihanyi Marcell
2023-06-12 20:09:11 +02:00
parent 3857896d6c
commit e255182b93
2 changed files with 4 additions and 6 deletions

View File

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