Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX treat register like sign in, even oauth #5033

Closed
wants to merge 3 commits into from

Conversation

coolaj86
Copy link
Contributor

@coolaj86 coolaj86 commented Oct 7, 2018

Re: #4226, #5032,

  • link oauth-created accounts just like normal ones
    • exception: make unlinkable when ALLOW_ONLY_EXTERNAL_REGISTRATION = true
  • remember me on sign up page
  • do not require a second login when account is created

If you'd like to test it out

My pull request is against master, but I run it as backport to v1.5.1 (includes #5006, #5029, #5033):

git clone https://github.com/coolaj86/gitea.git gitea.coolaj86 -b v1.5.1-coolaj86
pushd gitea.coolaj86
TAGS="bindata sqlite" make generate all

I would not recommend replacing your existing gitea, but rather creating a symlink so that you can easily switch back if you don't like it. For example, if you keep gitea in /opt/gitea/bin:

rsync -av ./gitea /opt/gitea/bin/gitea-v1.5.1-coolaj86
pushd /opt/gitea/bin
mv gitea gitea-v1.5.1
ln -s gitea-v1.5.1-coolaj86 gitea

I've run a couple of manual tests so far, so I feel comfortable with someone else trying it out. I won't be pushing any additional changes to that branch (such as the upcoming changes to address the empty checkboxes in the issue) until I've tested them in production for myself.

@coolaj86 coolaj86 changed the title treat register like sign in, even oauth UX treat register like sign in, even oauth Oct 7, 2018
@codecov-io
Copy link

codecov-io commented Oct 7, 2018

Codecov Report

Merging #5033 into master will increase coverage by 0.01%.
The diff coverage is 13.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5033      +/-   ##
==========================================
+ Coverage   41.15%   41.17%   +0.01%     
==========================================
  Files         464      464              
  Lines       62763    62757       -6     
==========================================
+ Hits        25833    25841       +8     
+ Misses      33537    33521      -16     
- Partials     3393     3395       +2
Impacted Files Coverage Δ
modules/auth/user_form.go 42.85% <ø> (ø) ⬆️
routers/user/auth.go 12.6% <13.95%> (+0.34%) ⬆️
models/gpg_key.go 55.83% <0%> (-0.84%) ⬇️
models/repo_list.go 73.09% <0%> (+1.01%) ⬆️
routers/repo/view.go 43.25% <0%> (+1.01%) ⬆️
models/unit.go 67.56% <0%> (+5.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5908bb1...b655b35. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 7, 2018
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Oct 8, 2018
@lafriks lafriks added this to the 1.7.0 milestone Oct 8, 2018
@techknowlogick techknowlogick modified the milestones: 1.7.0, 1.8.0 Dec 19, 2018
@stale
Copy link

stale bot commented Feb 17, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 17, 2019
@techknowlogick techknowlogick modified the milestones: 1.8.0, 1.9.0 Feb 19, 2019
@stale stale bot removed the issue/stale label Feb 19, 2019
@coolaj86
Copy link
Contributor Author

Rebased on master and ready for re-review!

@coolaj86
Copy link
Contributor Author

coolaj86 commented May 4, 2019

bump


// This will link the account in such a way that it cannot be removed
// TODO why is this different from normal linking?
if setting.Service.AllowOnlyExternalRegistration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. setting.Service.AllowOnlyExternalRegistration means user must register via external source. Since we have been in LinkAccountPostRegister. The check is unnecessary.

if err := models.UpdateUserCols(u, "is_admin", "is_active", "last_login_unix"); err != nil {
ctx.ServerError("UpdateUser", err)
// This will link the account in such a way that it can be removed
if !setting.Service.AllowOnlyExternalRegistration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

@lunny
Copy link
Member

lunny commented Jul 3, 2019

@solderjs could you remove setting.Service.AllowOnlyExternalRegistration conditions check on the changed code?

@zeripath
Copy link
Contributor

zeripath commented Jul 3, 2019

@lunny I think they might actually integral to the purpose of this pr.

From what I understand the purpose is about being able to remove the link of Gitea user from the external source.

@zeripath
Copy link
Contributor

zeripath commented Jul 3, 2019

Whether this is the correct technique to do that is another question.

I suspect we should be asking at the time of attempted removal of external links whether it's reasonable to do so.

@coolaj86
Copy link
Contributor Author

coolaj86 commented Jul 4, 2019

The goal is to be able to create a secure account that doesn't have a password that can be used as a backdoor to gain access.

If a local account is required, it thwarts the intent.

@techknowlogick techknowlogick modified the milestones: 1.9.0, 1.10.0 Jul 6, 2019
@stale
Copy link

stale bot commented Sep 4, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Sep 4, 2019
@lafriks
Copy link
Member

lafriks commented Sep 4, 2019

Need to resolve conflicts

@stale stale bot removed the issue/stale label Sep 4, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Sep 5, 2019
@techknowlogick techknowlogick modified the milestones: 1.10.0, 1.11.0 Oct 4, 2019
@lunny lunny modified the milestones: 1.11.0, 1.12.0 Dec 14, 2019
@lafriks lafriks modified the milestones: 1.12.0, 1.13.0 May 16, 2020
@lunny lunny modified the milestones: 1.13.0, 1.14.0 Sep 1, 2020
@lunny lunny modified the milestones: 1.14.0, 1.15.0 Jan 27, 2021
@techknowlogick techknowlogick modified the milestones: 1.15.0, 1.16.0 Jun 15, 2021
@lunny lunny removed this from the 1.16.0 milestone Nov 11, 2021
@wxiaoguang
Copy link
Contributor

It's stale for long time.

What's the status of this PR?

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels May 10, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants