Skip to content

Update login attempts button spins endlessly #4

@melegiul

Description

@melegiul

During login when keycloak after opening the app and clicking the Update button for login attempts, the loading circle spins endlessly. This was caused by an error handling the keycloak GET challenges response when the user account has no first name or no last name set.

I/flutter ( 9799): *** Response ***
I/flutter ( 9799): uri: https://.../realms/.../challenges?device_id=...
I/flutter ( 9799): statusCode: 200
I/flutter ( 9799): headers:
I/flutter ( 9799):  connection: keep-alive
I/flutter ( 9799):  date: Fri, 10 May 2024 12:28:11 GMT
I/flutter ( 9799):  strict-transport-security: max-age=31536000; includeSubDomains
I/flutter ( 9799):  content-length: 1683
I/flutter ( 9799):  referrer-policy: no-referrer
I/flutter ( 9799):  x-frame-options: SAMEORIGIN
I/flutter ( 9799):  content-type: application/json;charset=UTF-8
I/flutter ( 9799):  x-xss-protection: 1; mode=block
I/flutter ( 9799):  x-content-type-options: nosniff
I/flutter ( 9799):  server: nginx/1.22.1
I/flutter ( 9799): Response Text:
I/flutter ( 9799): [{userName: app, userLastName: app, targetUrl: ..., codeChallenge: ...
I/flutter ( 9799): 
E/flutter ( 9799): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
E/flutter ( 9799): #0      new Challenge.fromJson (package:keycloak_authenticator/src/dtos/challenge.dart:83:28)
E/flutter ( 9799): #1      KeycloakClient._getChallengesRequest.<anonymous closure> (package:keycloak_authenticator/src/keycloak_client.dart:162:31)
E/flutter ( 9799): #2      MappedListIterable.elementAt (dart:_internal/iterable.dart:425:31)
E/flutter ( 9799): #3      ListIterator.moveNext (dart:_internal/iterable.dart:354:26)
E/flutter ( 9799): #4      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
E/flutter ( 9799): #5      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
E/flutter ( 9799): #6      new List.of (dart:core-patch/array_patch.dart:39:18)
E/flutter ( 9799): #7      ListIterable.toList (dart:_internal/iterable.dart:224:7)
E/flutter ( 9799): #8      KeycloakClient._getChallengesRequest (package:keycloak_authenticator/src/keycloak_client.dart:163:10)
E/flutter ( 9799): <asynchronous suspension>
E/flutter ( 9799): #9      KeycloakClient.getChallenges (package:keycloak_authenticator/src/keycloak_client.dart:127:14)
E/flutter ( 9799): <asynchronous suspension>
E/flutter ( 9799): #10     KeycloakAuthenticator.fetchChallenge (package:keycloak_authenticator/src/keycloak_authenticator.dart:78:22)
E/flutter ( 9799): <asynchronous suspension>
E/flutter ( 9799): #11     AuthenticatorModel.refresh (package:kc_auth_app/features/authenticator/models/authenticator_model.dart:91:23)
E/flutter ( 9799): <asynchronous suspension>
E/flutter ( 9799): #12     _ReadyView.onRefresh (package:kc_auth_app/features/authenticator/screens/authenticator_screen.dart:189:19)
E/flutter ( 9799): <asynchronous suspension>

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions