Skip to content

Commit

Permalink
🐛chore(0.1.4): fixed invalid state in login-screen and biometric state (
Browse files Browse the repository at this point in the history
#34)

* fix: user state biometric (#33)

* feat: new type connection to proxy (#9)

* refactor: change type variable .env

* feat: connection to the proxy via HTTP & check new endpoints

* feat: terms and conditions modal

Terms and conditions modal is added at the time of user registration.
In addition, the auto_size_text package is added for text management on different devices

* feat: validation of fields in the registration form

Implementation of the registration form fields with their validation.

* feat: validating equal passwords in form.

Password validation is done on the registration form, in addition to using modal when validating fields.

* feat: register options with merge biometricts login

registration functionality through username and password

* feat: register added (#26) & change to secure storage

* feat: customErros added of proxy response (#25)

* refactor: recome closeModalCallback

* fix: temporary authentication & authentication with biometrics under states (#24)

* fix: state invalid in login-screen (#28)
  • Loading branch information
SantiagoGaonaC authored Oct 11, 2023
1 parent eedbbbd commit 28aa9c0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 0.1.4 (2023-10-11)


### Bug Fixes

* user state biometric ([#33](https://github.com/hawks-atlanta/frontend-flutter/issues/33)) ([117c856](https://github.com/hawks-atlanta/frontend-flutter/commit/117c85601493f922df02ef1efbddab9abbe203e7)), closes [#9](https://github.com/hawks-atlanta/frontend-flutter/issues/9) [#26](https://github.com/hawks-atlanta/frontend-flutter/issues/26) [#25](https://github.com/hawks-atlanta/frontend-flutter/issues/25) [#24](https://github.com/hawks-atlanta/frontend-flutter/issues/24) [#28](https://github.com/hawks-atlanta/frontend-flutter/issues/28)

### 0.1.3 (2023-10-11)

### 0.1.2 (2023-10-11)


Expand Down
27 changes: 18 additions & 9 deletions lib/features/auth/presentation/providers/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,26 @@ class AuthNotifier extends StateNotifier<AuthState> {
_verifyToken(biometricToken);
return;
}

//Después intentamos con el token temporal
final tempToken =
await keyValueStorageService.getValue<String>('tempToken');

// Independientemente de si tempToken es nulo o no, ejecutamos el logout
// y ajustamos el estado.
// Ya que tempToken indica usuario temporal!
state = state.copyWith(hasBiometric: false);
logout();

// Luego, si tempToken no es nulo, puedes verificarlo o hacer
// cualquier lógica adicional si es necesario.
if (tempToken != null) {
// Se hace el logout para que se borre el token temporal
// Si desea un usuario temp volver a entrar se borra
// Si se quiere cambiar el estado entonces hacer un _verifyTokenTemp(tempToken)
logout();
//_verifyToken(tempToken);
return;
// [Lógica adicional aquí si tempToken existe, de momento no]
}

//Si llegamos hasta aquí, no hay token.
logout();
// [Posiblemente lógica adicional aquí si no hay token]
}

void _verifyToken(String token) async {
Expand Down Expand Up @@ -175,12 +182,14 @@ class AuthNotifier extends StateNotifier<AuthState> {
if (hasBiometric != true) {
await keyValueStorageService.removeKey('token');
await keyValueStorageService.removeKey('username');
await keyValueStorageService.removeKey('tempToken');
}

state = state.copyWith(
user: null,
errorMessage: errorMessage,
authStatus: AuthStatus.notAuthenticated);
user: null,
errorMessage: errorMessage,
authStatus: AuthStatus.notAuthenticated,
);
}

Future<void> biometricError([String? errorMessage]) async {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"git-semver-tags": "^4.1.1",
"standard-version": "^9.5.0"
},
"version": "0.1.2"
"version": "0.1.4"
}

0 comments on commit 28aa9c0

Please sign in to comment.