diff --git a/filcnaplo/lib/api/login.dart b/filcnaplo/lib/api/login.dart index 0e2df02..9f3b2fd 100644 --- a/filcnaplo/lib/api/login.dart +++ b/filcnaplo/lib/api/login.dart @@ -57,15 +57,13 @@ Future loginApi({ String nonceStr = await Provider.of(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(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, diff --git a/filcnaplo_kreta_api/lib/client/client.dart b/filcnaplo_kreta_api/lib/client/client.dart index a859479..9910d60 100644 --- a/filcnaplo_kreta_api/lib/client/client.dart +++ b/filcnaplo_kreta_api/lib/client/client.dart @@ -169,7 +169,7 @@ class KretaClient { Map? loginRes = await postAPI(KretaAPI.login, headers: headers, body: User.loginBody( - username: loginUser.username.replaceAll(' ', '') + ' ', + username: loginUser.username, password: loginUser.password, instituteCode: loginUser.instituteCode, ));