GithubHelp home page GithubHelp logo

Comments (16)

joubertredrat avatar joubertredrat commented on May 1, 2024 3

@strk If define email as UNIQUE in database and creates validation solves the problem

from gitea.

strk avatar strk commented on May 1, 2024 1

@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.

from gitea.

richmahn avatar richmahn commented on May 1, 2024 1

@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.

from gitea.

strk avatar strk commented on May 1, 2024

I think forbidding multiple users with same email could be a good idea, in general.

from gitea.

lunny avatar lunny commented on May 1, 2024

An unique maybe not a good idea since there are the same email. It will result in the gitea can not start.

from gitea.

lunny avatar lunny commented on May 1, 2024

If user already have same emails on gitea/gogs database, when he upgrade gitea to the new version, it will report a migration error and will not start the service. At this situation, user MUST change the user's email on the database manually. That's not our expected situation. So we have to resolve this before we add an unique tag on email field.

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024

If define email as UNIQUE in database and creates validation solves the problem

Like @lunny says, I've seen people (and bugs related to) use the same email for several accounts so a migration would be necessary.

Proposed migration flow:

No Collisions

  • Currently at v0.9
  • Upgrade to v1.1.0 (current milestone for this issue)
  • Migration runs on start
  • No duplicate emails found, Gogs starts as usual

Collisions

  • Currently at v0.9
  • Upgrade to v1.1.0 (current milestone for this issue)
  • Migration runs on start
  • Duplicate emails found, Gogs fails migration and throws an Error

PREFERED No Collisions

  • Currently at v0.9
  • Upgrade to v1.1.0 (current milestone for this issue)
  • Migration runs on start
  • No duplicate emails found, Gogs starts in Maintenance-mode, requiring Admins for login. Everything locked down except for settings.

Preferred way required Maintenance-mode (which hasn't been requested but would be nice :trollface: )

from gitea.

strk avatar strk commented on May 1, 2024

@bkcsoft you mean Duplicate emails found in the last bullet, right ?

I think we should go there incrementally, and the first step is preventing the registration of users with the same email as other users. From the original report in this ticket there is an attempt in code to prevent that (see how second user could not register with same email) but evidently not all code paths do check for that occurrence.

from gitea.

bkcsoft avatar bkcsoft commented on May 1, 2024

@strk Correct. Changed the text now ๐Ÿ˜†

Indeed it should be done incrementally, could you have a look at that? ๐Ÿ™‚

from gitea.

richmahn avatar richmahn commented on May 1, 2024

Any work been done on this? We are needing to fix the problem as we have many people signing up through the API and they sometimes use the same email address, forgetting they are already in our system but with a different username.

from gitea.

lunny avatar lunny commented on May 1, 2024

We maybe fix this on 1.1. We would like to limit email should be uniqued. So that every user have to use different email. Maybe you can ask your guys to change their email address?

from gitea.

strk avatar strk commented on May 1, 2024

from gitea.

simonszu avatar simonszu commented on May 1, 2024

I have noticed a similar behaviour which is somehow related to the duplicate-email-issue.
I have set up a fresh instance of gitea without migrating from gogits. I have created two users with different email addresses but changed one user's mail address to the other's after that.

The result is an Error 500 every time one of these users try to login. However, the session starts up fine, and if you manually navigate to the logged in user's dashboard, it seems to work - until you go and view the commit history of a repo or single file and try to view an older commit. There you get an Error 500 as well which is not workaroundable.

So i think a unique flag for email addresses and enforcing it at registration or in the user control panel would be the best solution.

from gitea.

lunny avatar lunny commented on May 1, 2024

@simonszu which version have you installed?

from gitea.

simonszu avatar simonszu commented on May 1, 2024

@lunny I am a bit surprised that my installation does not report any version number, but a commit hash. It is Version: 6aacf4d. I installed it around Febrary 6th, 2017.

from gitea.

lunny avatar lunny commented on May 1, 2024

Yes. That's v1.0.1. I will fix this issue these days.

from gitea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.