Chinese name from oauth will cause login failure #2230

Closed
opened 2026-03-22 13:58:20 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @maggch97 on GitHub (May 21, 2025).

Description

When I login with oauth and my account name is Chinese, there's no error message but go back to vikunja login page.
I repro this issue with local db and postgres, will do more debug and update more info here.

Vikunja Version

latest unstable

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

Originally created by @maggch97 on GitHub (May 21, 2025). ### Description When I login with oauth and my account name is Chinese, there's no error message but go back to vikunja login page. I repro this issue with local db and postgres, will do more debug and update more info here. ### Vikunja Version latest unstable ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Please select ### Screenshots _No response_
Author
Owner

@maggch97 commented on GitHub (May 21, 2025):

https://deepwiki.com/search/when-the-users-name-is-in-chin_42705e93-e257-41af-acea-18c8154c797a

The answer from deepwiki looks correct

The solution is to correct the regex replacement patterns in frontend/src/stores/auth.ts:

const base64 = jwt  
  .split('.')[1]  
  .replace(/-/g, '+')  // Correct regex syntax  
  .replace(/_/g, '/')  // Correct regex syntax
@maggch97 commented on GitHub (May 21, 2025): https://deepwiki.com/search/when-the-users-name-is-in-chin_42705e93-e257-41af-acea-18c8154c797a The answer from deepwiki looks correct The solution is to correct the regex replacement patterns in frontend/src/stores/auth.ts: ``` const base64 = jwt .split('.')[1] .replace(/-/g, '+') // Correct regex syntax .replace(/_/g, '/') // Correct regex syntax ```
Author
Owner

@kolaente commented on GitHub (May 21, 2025):

Duplicate of https://github.com/go-vikunja/vikunja/issues/388

@kolaente commented on GitHub (May 21, 2025): Duplicate of https://github.com/go-vikunja/vikunja/issues/388
Author
Owner

@maggch97 commented on GitHub (May 21, 2025):

Duplicate of #388

The fix of that issue has a mistake in regex syntax. You can check above answer from deepwiki. Please reopen this issue, I will push a fix later

@maggch97 commented on GitHub (May 21, 2025): > Duplicate of [#388](https://github.com/go-vikunja/vikunja/issues/388) The fix of that issue has a mistake in regex syntax. You can check above answer from deepwiki. Please reopen this issue, I will push a fix later
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#2230