Skip to content

Commit

Permalink
feat: add recovery flow to Flutter App (#89)
Browse files Browse the repository at this point in the history
* feat: get current session information

* feat: create login flow

* feat: login with email and password

* feat: register with email and password

* fix: handle all errors incl deserialization error

* feat: logout & get session on home page init

* feat: show session information

* feat: add design and refactor blocs

* fix: change package and folder name

* fix: change package name

* docs: update README.md

* refactor: delete unused icon

* refactor: remove unused packages

* chore: format code

* refactor: add missing package and delete unused test

* feat: change password in settings

* design: add padding to messages

* feat: refresh session when updating settings

* design: add assets' variants

* feat: display settings dynamically

* chore: create  widgets

* fix: chnge submit button value

* chore: format code

* chore: display components dynamically

* chore: clean up and format code

* fix: aal2 navigation

* chore: remove unnecessary code

* feat: sign in/up with google account on iOS

* chore: add ios url scheme and web clientId

* chore: fix typo and rename variables

* chore: separate exception handlings

* fix: prevent null exception

* chore: delete unused assets & widgets

* fix: remove pop & show provider buttons correctly

* chore: separate exception handlings

* chore: format code

* chore: change package name and add auth packages

* feat: add apple & google sign in

* chore: delete unnecessary exception handling

* feat: add flutter app Ory Network example  (#82)

* feat: get current session information

* feat: create login flow

* feat: login with email and password

* feat: register with email and password

* fix: handle all errors incl deserialization error

* feat: logout & get session on home page init

* feat: show session information

* feat: add design and refactor blocs

* fix: change package and folder name

* fix: change package name

* docs: update README.md

* refactor: delete unused icon

* refactor: remove unused packages

* chore: format code

* refactor: add missing package and delete unused test

* chore: display components dynamically

* chore: clean up and format code

* fix: aal2 navigation

* chore: remove unnecessary code

* chore: fix typo and rename variables

* chore: separate exception handlings

* fix: prevent null exception

* chore: delete unused assets and widgets

* chore: remove misleading widget

* Update README.md

* Update README.md

* chore: add formatting

* chore: add formatting

* chore: regenerate freezed files

* fix: rebuild settings page or reset buttons

* chore: refactor auth state & add missing social login functionality

* chore: use helpers to get nodes of group

* fix: reset settings when navigating back

* chore: delete build artifacts

* feat: add recovery bloc

* chore: add conditions for navigation

* fix: update conditions

* chore: add exception handling in reset settings & remove snackbar

* chore: remove unused attributes
  • Loading branch information
sashatalalasha committed Dec 28, 2023
1 parent b23f3a2 commit e61b862
Show file tree
Hide file tree
Showing 28 changed files with 1,604 additions and 313 deletions.
10 changes: 6 additions & 4 deletions flutter-ory-network/lib/blocs/auth/auth_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
}

_onAddSession(AddSession event, Emitter<AuthState> emit) {
emit(AuthState.authenticated(session: event.session));
emit(AuthState.authenticated(
session: event.session, conditions: event.conditions));
}

_onChangeAuthStatus(ChangeAuthStatus event, Emitter<AuthState> emit) {
switch (event.status) {
case AuthStatus.unauthenticated:
emit(const AuthState.unauthenticated());
case AuthStatus.aal2Requested:
emit(const AuthState.aal2Requested());
emit(AuthState.aal2Requested(conditions: event.conditions));
default:
emit(state);
}
Expand All @@ -52,11 +53,12 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {

final session = await repository.getCurrentSessionInformation();

emit(AuthState.authenticated(session: session));
emit(AuthState.authenticated(
session: session, conditions: event.conditions));
} on UnauthorizedException catch (_) {
emit(const AuthState.unauthenticated());
} on TwoFactorAuthRequiredException catch (_) {
emit(const AuthState.aal2Requested());
emit(AuthState.aal2Requested(conditions: event.conditions));
} on UnknownException catch (e) {
emit(state.copyWith(isLoading: false, errorMessage: e.message));
} catch (_) {
Expand Down
Loading

0 comments on commit e61b862

Please sign in to comment.