Skip to content

Login with Safari: Error updating user language #14793

Closed
@louis77

Description

@louis77

This is a follow-up to issue #9806 which is closed and unfortunately not available for reopening.

Logging in with Safari Version 14.0.3 (16610.4.3.1.4) causes the following error message:

routers/user/auth.go:524:[handleSignInFull()] Error updating user language [user: 3, locale: de-DE-u-rg-chzzzz]

and shows an empty page. Obviously Safari is sending a strange locale.

Checking with whatismyip.org:

HTTP_HOST: www.whatsmyip.org
HTTP_ACCEPT: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8
HTTP_ACCEPT_LANGUAGE: de-ch
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT_ENCODING: gzip, deflate, br
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15

Gitea version: 1.13.2 built with GNU Make 4.2.1, go1.14.6 : bindata
Running gitea binary compiled from source with no reverse proxies on port 443
OS: Linux 4.19.0-13-cloud-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
DB: PostgreSQL 12

Feb 24 22:18:13 runner gitea[8819]: [Macaron] 2021-02-24 22:18:13: Started POST /user/login for 77.58.0.94
Feb 24 22:18:13 runner gitea[8819]: [Macaron] 2021-02-24 22:18:13: Completed POST /user/login 0  in 149.066657ms
Feb 24 22:18:13 runner gitea[8819]: #033[36m2021/02/24 22:18:13 #033[0m#033[32mrouters/user/auth.go:524:#033[32mhandleSignInFull()#033[0m #033[1;31m[E]#033[0m Error updating user language [user: 1, locale: de-DE-u-rg-chzzzz]
F

I've changed the language column in the user table:

ALTER TABLE "public"."user" ALTER COLUMN "language" SET DATA TYPE varchar(20);

then the error goes away. So either the locale must be stripped or the column length must be made greater than 5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions