gitea: Different users with same e-mail causes error on create repositores and user creation from register
- Gogs version (or commit ref): 0.9.97.0901
- Git version: 1.9.1
- Operating system: Ubuntu 14.04.5 LTS x64
- Database (use
[x]):- PostgreSQL
- MySQL
- SQLite
- Can you reproduce the bug at https://try.gogs.io:
- Log gist: https://gist.github.com/joubertredrat/7792a5e54410795c8cca270f96a4efe2
Description
I identified 2 issues about different users with same e-mail, one on my environment and other on demo.
On mine Gogs instance I have my one user provided by SMTP authentication with e-mail my@email. Today I created one local user with same e-mail my@email. After this, both users can’t create repositories, as is in gist above. Other users can create repositories without problems.
For see if I can reproduce same problem, I go to test on Gogs demo, I created user redrat1 without problems. Then, I created user redrat2 with same email from redrat1. I received email to activate account, but If I try to enable user redrat2, causes error 500.
Reference: https://github.com/gogits/gogs/issues/3681
<bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38896692-different-users-with-same-e-mail-causes-error-on-create-repositores-and-user-creation-from-register?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- fix #13 — committed to lunny/gitea by lunny 7 years ago
- fix #13 (#1042) — committed to go-gitea/gitea by lunny 7 years ago
- Merge pull request #13 from go-gitea/editorconfig-end-of-line .editorconfig: Do not specify end_of_line — committed to lunny/gitea by andreynering 8 years ago
- Added English localization for filter_projects (#13) — committed to 6543-forks/gitea by deleted user 4 years ago
@strk If define email as UNIQUE in database and creates validation solves the problem
@strk: We work on Gogs as a company, but mainly our own customizations (click on my above issue I made for our developers to see our repo, which is tailored for content editing and content linking/scrubbing/etc. rather than coding), but do try to do what we can for upstream (gitea), so if we tackle the issue I made, we will do it for upstream.
@lunny: Every time the 500 error comes up, we finally (hopefully more quickly now than before) realize it is this bug and have to make a quick email change. I guess we need to somehow search for the email address from the app/api before signing someone up for now.
@lunny that’s a migration/upgrade problem, yes, but if we think same-email should not be allowed, it would be useful to start preventing that for future accounts at least. Of course it’s also important for code to be tolerant to unexpected database states.