[GH-ISSUE #102] Resetting user preferences during login #5970

Closed
opened 2026-04-20 16:26:18 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @liamgilbey on GitHub (Dec 22, 2023).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/102

Description

I have an issue where Vikjuna is resetting user preferences when they login.

I have setup Vikjuna with OIDC integration handled by Authelia, and I can successfully login and update user preferences. My setup is with MariaDB, and I can confirm a value in the database is updated when a user preference is changed.

image

However, if that users logs out and in again, that preference is gone

image

I've reviewed the MariaDB logs and I can see the following happening:


UPDATE `users` SET `name` = '<user>', `username` = '<username>', `email` = '<email>', `avatar_provider` = '', `avatar_file_id` = 0, `email_reminders_enabled` = 0, `discoverable_by_name` = 0, `discoverable_by_email` = 0, `overdue_tasks_reminders_enabled` = 0, `overdue_tasks_reminders_time` = '9:00', `default_project_id` = 0, `week_start` = 0, `language` = 'en', `timezone` = 'Pacific/Auckland', `frontend_settings` = '{\"color_schema\":\"auto\",\"play_sound_when_done\":true,\"quick_add_magic_mode\":\"vikunja\"}', `updated` = '2023-12-22 17:34:54' WHERE `id`=1

It's as if every time a user logs on, the api is treating them like a new user.

Vikunja Frontend Version

0.22.0

Vikunja API Version

0.22.0

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @liamgilbey on GitHub (Dec 22, 2023). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/102 ### Description I have an issue where Vikjuna is resetting user preferences when they login. I have setup Vikjuna with OIDC integration handled by Authelia, and I can successfully login and update user preferences. My setup is with MariaDB, and I can confirm a value in the database is updated when a user preference is changed. ![image](https://github.com/go-vikunja/api/assets/8405101/71e75376-577d-415e-bac6-a0952f2bfaa7) However, if that users logs out and in again, that preference is gone ![image](https://github.com/go-vikunja/api/assets/8405101/95617b06-008c-4e0a-8c13-b636d3bead9c) I've reviewed the MariaDB logs and I can see the following happening: ```sql UPDATE `users` SET `name` = '<user>', `username` = '<username>', `email` = '<email>', `avatar_provider` = '', `avatar_file_id` = 0, `email_reminders_enabled` = 0, `discoverable_by_name` = 0, `discoverable_by_email` = 0, `overdue_tasks_reminders_enabled` = 0, `overdue_tasks_reminders_time` = '9:00', `default_project_id` = 0, `week_start` = 0, `language` = 'en', `timezone` = 'Pacific/Auckland', `frontend_settings` = '{\"color_schema\":\"auto\",\"play_sound_when_done\":true,\"quick_add_magic_mode\":\"vikunja\"}', `updated` = '2023-12-22 17:34:54' WHERE `id`=1 ``` It's as if every time a user logs on, the api is treating them like a new user. ### Vikunja Frontend Version 0.22.0 ### Vikunja API Version 0.22.0 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Dec 22, 2023):

It's as if every time a user logs on, the api is treating them like a new user.

Can you verify if the user is created on every login?

<!-- gh-comment-id:1867969961 --> @kolaente commented on GitHub (Dec 22, 2023): > It's as if every time a user logs on, the api is treating them like a new user. Can you verify if the user is created on every login?
Author
Owner

@liamgilbey commented on GitHub (Dec 22, 2023):

From the database perspective, it's not. I can see the user list is not growing, and instead the record has all attributes reset as in the SQL query above. I can also see the created column stays the same, but the updated column is updated with the timestamp of the login

<!-- gh-comment-id:1867997762 --> @liamgilbey commented on GitHub (Dec 22, 2023): From the database perspective, it's not. I can see the user list is not growing, and instead the record has all attributes reset as in the SQL query above. I can also see the `created` column stays the same, but the `updated` column is updated with the timestamp of the login
Author
Owner

@kolaente commented on GitHub (Dec 25, 2023):

Looks like this only happened when the user's name or email had changed in the external auth provider.

Should be fixed in a5a6aba7c8. Please check with the next unstable build if your problem went away.

<!-- gh-comment-id:1869041046 --> @kolaente commented on GitHub (Dec 25, 2023): Looks like this only happened when the user's name or email had changed in the external auth provider. Should be fixed in a5a6aba7c80618a45bb57616c7378917675cadab. Please check with the next unstable build if your problem went away.
Author
Owner

@liamgilbey commented on GitHub (Dec 25, 2023):

I can confirm that works nicely - thank you

<!-- gh-comment-id:1869081892 --> @liamgilbey commented on GitHub (Dec 25, 2023): I can confirm that works nicely - thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5970