captain-fact icon indicating copy to clipboard operation
captain-fact copied to clipboard

Crash when registering from Facebook with a name length > 20

Open Betree opened this issue 7 years ago • 0 comments

See error in Rollbar: https://rollbar.com/captainfact/CaptainFact-API/items/9/

File lib/accounts/accounts.ex line 162 in CF.Accounts.create_account_without_username/3 (cf)
File lib/accounts/accounts.ex line 51 in CF.Accounts.create_account/3 (cf)
File lib/authenticator/oauth.ex line 39 in CF.Authenticator.OAuth.find_or_create_user!/2 (cf)
File lib/controllers/auth_controller.ex line 52 in CF.RestApi.AuthController.callback/2 (cf_rest_api)
File lib/controllers/auth_controller.ex line 1 in CF.RestApi.AuthController.action/2 (cf_rest_api)
File lib/controllers/auth_controller.ex line 1 in CF.RestApi.AuthController.phoenix_controller_pipeline/2 (cf_rest_api)
File lib/endpoint.ex line 1 in CF.RestApi.Endpoint.instrument/4 (cf_rest_api)
File lib/phoenix/router.ex line 278 in Phoenix.Router.__call__/1 (phoenix)
CaseClauseError: no case clause matching: {:error, :base_user, #Ecto.Changeset<action: :insert, changes: %{achievements: [1], email: "[email protected]", email_confirmation_token: "xxxxxxxxxxxxxxxxxxxx", name: "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", password: "xxxxxxxxxx"}, errors: [name: {"should be at most %{count} character(s)", [count: 20, validation: :length, max: 20]}], data: #DB.Schema.User<>, valid?: false>, %{}}

Quick fix

Cut name at 20.

Future perspectives

We should allow for longer names

Betree avatar Dec 14 '18 00:12 Betree