FEAT: oauth2: use link_account page when email/username is missing #1757
No reviewers
Labels
No Label
backport/v1.19
backport/v1.20
backport/v1.21
bug
dependency
Chi
dependency
Chroma
dependency
citation.js
dependency
devcontainers
dependency
dropzone
dependency
F3
dependency
ForgeFed
dependency
garage
dependency
Gitea
dependency
go-enry
dependency
Go-org
dependency
go-sql-driver mysql
dependency
Golang
dependency
goldmark
dependency
Goth
dependency
Helm
dependency
MariaDB
dependency
Mermaid
dependency
minio-go
dependency
Monaco
dependency
PDFobject
dependency
ssh
dependency
urfave
dependency
Woodpecker CI
dependency
XORM
Discussion
duplicate
enhancement/feature
forgejo/accessibility
forgejo/actions
forgejo/branding
forgejo/ci
forgejo/documentation
forgejo/federation
forgejo/furnace cleanup
forgejo/internationalization
forgejo/moderation
forgejo/privacy
forgejo/release
forgejo/scaling
forgejo/security
forgejo/ui
issue
closed
issue
do-not-exist-yet
issue
open
OS
FreeBSD
OS
Linux
OS
MacOS
OS
Windows
ready-to-merge
untested
User Research - bug
User Research - communication
User Research - documentation
User Research - feature
User Research - federation
User Research - governance
User Research - release
User Research - security
User Research - testing
User Research - UI
User Research - UX
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: forgejo/forgejo#1757
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "wetneb/forgejo:1755-oauth2-missing-email"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This avoids simply failing with an HTTP 500 error instead.
Closes #1755.
This is a work in progress,I am looking for feedback on this approach :)I like the idea.
Heads up: Forgejo is being rebased on Gitea today (that's a weekly occurrence). It means you will need to cherry-pick your commits on top of the newer base branch for this PR and maybe resolve conflicts. You can do that on your own time, you do not need to do that today. It can be in a week or a month and you can keep working in the meantime.
Ideally Gitea would be a package that can be upgraded as any other Go package. But it is not designed in this way and the weekly rebase is the equivalent of such an upgrade, only it is more work.
If you need help doing that, feel free to reach out in the development chatroom.
a61fc88726
to54fa881cba
54fa881cba
to687ad13956
687ad13956
toc7206910b7
215a20078a
toee6885faf0
ee6885faf0
to50e6c28c6b
50e6c28c6b
to5f1f6a1ce4
WIP: oauth2: use link_account page when email/username is missingto FEAT: oauth2: use link_account page when email/username is missing@earl-warren thanks for the encouragement! I would declare it ready for review then :)
@ -970,1 +971,3 @@
ctx.ServerError("CreateUser", err)
// we don't have enough information to create an account automatically,
// so we prompt the user for the remaining bits
showLinkingLogin(ctx, gothUser)
I think it's good to add a
log.Trace
to show which fields were missing.Fair enough, I have added one.
@ -472,0 +473,4 @@
func TestSignUpViaOAuthWithMissingFields(t *testing.T) {
defer tests.PrepareTestEnv(t)()
// enable auto-creation of accounts via OAuth2
setting.OAuth2Client.EnableAutoRegistration = true
This has to be disabled after this.
That's a most excellent point. Did I do it right?
Yes, perfect!
f6ca2f749c
to2d343db363
2d343db363
to127a86d452
For the record, moved the commit to the
forgejo-dependency
branch where it belongs.Thanks, I'll make sure I'll use that branch for my upcoming PRs.
Thanks! It's perfectly ok to target forgejo if unsure: moving commits around is quite common in the Forgejo workflow.