+ {{/* these styles are quite tricky and should also apply to the signup and link_account pages */}}
{{template "user/auth/signin_inner" .}}
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index b3b2a4205e1ce..d66568199dd8d 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -59,12 +59,12 @@
+ {{if not .LinkAccountMode}}
- {{if not .LinkAccountMode}}
{{ctx.Locale.Tr "auth.already_have_account"}} {{ctx.Locale.Tr "auth.sign_in_now"}}
- {{end}}
+ {{end}}
diff --git a/tests/integration/signin_test.go b/tests/integration/signin_test.go index d7c0b1bcd383f..a76287ca94609 100644 --- a/tests/integration/signin_test.go +++ b/tests/integration/signin_test.go @@ -15,8 +15,11 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/test" "code.gitea.io/gitea/modules/translation" + "code.gitea.io/gitea/modules/web" + "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/tests" + "github.com/markbates/goth" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -98,6 +101,11 @@ func TestSigninWithRememberMe(t *testing.T) { func TestEnablePasswordSignInForm(t *testing.T) { defer tests.PrepareTestEnv(t)() + mockLinkAccount := func(ctx *context.Context) { + gothUser := goth.User{Email: "invalid-email", Name: "."} + _ = ctx.Session.Set("linkAccountGothUser", gothUser) + } + t.Run("EnablePasswordSignInForm=false", func(t *testing.T) { defer tests.PrintCurrentTest(t)() defer test.MockVariableValue(&setting.Service.EnablePasswordSignInForm, false)() @@ -108,6 +116,12 @@ func TestEnablePasswordSignInForm(t *testing.T) { req = NewRequest(t, "POST", "/user/login") MakeRequest(t, req, http.StatusForbidden) + + req = NewRequest(t, "GET", "/user/link_account") + defer web.RouteMockReset() + web.RouteMock(web.MockAfterMiddlewares, mockLinkAccount) + resp = MakeRequest(t, req, http.StatusOK) + NewHTMLParser(t, resp.Body).AssertElement(t, "form[action='/user/link_account_signin']", false) }) t.Run("EnablePasswordSignInForm=true", func(t *testing.T) { @@ -120,5 +134,11 @@ func TestEnablePasswordSignInForm(t *testing.T) { req = NewRequest(t, "POST", "/user/login") MakeRequest(t, req, http.StatusOK) + + req = NewRequest(t, "GET", "/user/link_account") + defer web.RouteMockReset() + web.RouteMock(web.MockAfterMiddlewares, mockLinkAccount) + resp = MakeRequest(t, req, http.StatusOK) + NewHTMLParser(t, resp.Body).AssertElement(t, "form[action='/user/link_account_signin']", true) }) } From 076d122f3487fa4969f974e575a5903f4cc4729d Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 20 Jan 2025 00:41:15 +0100 Subject: [PATCH 09/10] Fix typo in documentation of GetBranchNames() (#33330) --- modules/git/repo_branch_gogit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/repo_branch_gogit.go b/modules/git/repo_branch_gogit.go index dbc4a5fedc91b..77aecb21ebd27 100644 --- a/modules/git/repo_branch_gogit.go +++ b/modules/git/repo_branch_gogit.go @@ -57,7 +57,7 @@ func (repo *Repository) IsBranchExist(name string) bool { // GetBranches returns branches from the repository, skipping "skip" initial branches and // returning at most "limit" branches, or all branches if "limit" is 0. -// Branches are returned with sort of `-commiterdate` as the nogogit +// Branches are returned with sort of `-committerdate` as the nogogit // implementation. This requires full fetch, sort and then the // skip/limit applies later as gogit returns in undefined order. func (repo *Repository) GetBranchNames(skip, limit int) ([]string, int, error) { From 13dbd260b79c57c034860fbdbd1ae5f4412f9671 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Mon, 20 Jan 2025 00:31:52 +0000 Subject: [PATCH 10/10] [skip ci] Updated licenses and gitignores --- options/gitignore/Node | 6 ++++++ options/gitignore/Python | 3 +++ options/gitignore/Rust | 4 ---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/options/gitignore/Node b/options/gitignore/Node index c6bba59138121..1170717c1478b 100644 --- a/options/gitignore/Node +++ b/options/gitignore/Node @@ -104,6 +104,12 @@ dist .temp .cache +# vitepress build output +**/.vitepress/dist + +# vitepress cache directory +**/.vitepress/cache + # Docusaurus cache and generated files .docusaurus diff --git a/options/gitignore/Python b/options/gitignore/Python index 15201acc113da..0a197900e25d2 100644 --- a/options/gitignore/Python +++ b/options/gitignore/Python @@ -167,5 +167,8 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +# Ruff stuff: +.ruff_cache/ + # PyPI configuration file .pypirc diff --git a/options/gitignore/Rust b/options/gitignore/Rust index d01bd1a990b41..0104787a738b5 100644 --- a/options/gitignore/Rust +++ b/options/gitignore/Rust @@ -3,10 +3,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk