Skip to content

Add default Authentication Switch - #5338

Merged
unknwon merged 6 commits into
gogs:developfrom
norajam:default_authtication
Sep 13, 2018
Merged

unknwon merged 6 commits into
gogs:developfrom
norajam:default_authtication

Conversation

@norajam

@norajam norajam commented Jul 12, 2018

Copy link
Copy Markdown
Contributor

The changes will add a default authentication switch so that user doesn't need select their authentication source every time on the login page. This will save engineers time and money.

For example, if this select action from dropdown list will cost 1s and Gogs has 1,000,000 users, it will then cost 11.6 days on switching different authentication method. If one second will cost developer 1 cent, it will then save $10,000 money!

@unknwon

unknwon commented Aug 18, 2018

Copy link
Copy Markdown
Member

Thanks for the PR!

But this does not work well if admin sets authentication source via config file. So I think the better approach is to set a default authentication source ID, if not exist then use whatever the first authentication source found.

@norajam

norajam commented Aug 20, 2018

Copy link
Copy Markdown
Contributor Author

@unknwon I added a default source radio each column to turn on the default source from the admin console.

As far as authentication source with the config file, will it show in UI after application up? If not, we need to reconsider it, thanks for your feedback!

Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
@unknwon

unknwon commented Sep 8, 2018 •

Copy link
Copy Markdown
Member

As far as authentication source with the config file, will it show in UI after application up?

Yes, they will show on the same list (in admin panel) as if you added a login source via Web UI.

@unknwon unknwon changed the title Add default Authentication Switch. Add default Authentication Switch Sep 10, 2018
Comment thread models/login_source.go Resolved
#2, Fix a bug in "Edit" panel.
Comment thread models/login_source.go Outdated
}

localLoginSources.UpdateLoginSource(source)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we also call ResetNonDefaultLoginSources here?

Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
@norajam

norajam commented Sep 11, 2018

Copy link
Copy Markdown
Contributor Author

@unknwon I added back the memory flush because local authentication files need this update. Thanks for your review.

Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
Comment thread models/login_source.go Resolved
@unknwon unknwon added status: waits for QA The changes looks good, just need some sanity check from maintainers and removed status: needs feedback Tell me more about it labels Sep 11, 2018
@unknwon

unknwon commented Sep 11, 2018

Copy link
Copy Markdown
Member

Thanks for the work! Looks like in a good shape now.

@norajam

norajam commented Sep 11, 2018

Copy link
Copy Markdown
Contributor Author

Thanks!

@unknwon
unknwon merged commit 68a6579 into gogs:develop Sep 13, 2018
@unknwon unknwon removed the status: waits for QA The changes looks good, just need some sanity check from maintainers label Sep 13, 2018
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants