diff --git a/README.md b/README.md
index 19703d85dd..29d5371a36 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,14 @@
-
+
-
-
+
+
@@ -45,7 +45,7 @@
-
+
diff --git a/README_ZH.md b/README_ZH.md
index 0e58ad6d4a..285a814037 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -12,14 +12,14 @@
-
+
-
-
+
+
@@ -45,7 +45,7 @@
-
+
diff --git a/models/project/project.go b/models/project/project.go
index 8bac9115ba..273823ac9d 100644
--- a/models/project/project.go
+++ b/models/project/project.go
@@ -123,7 +123,7 @@ func (p *Project) Link() string {
log.Error("LoadOwner: %v", err)
return ""
}
- return fmt.Sprintf("/%s/-/projects/%d", p.Owner.Name, p.ID)
+ return fmt.Sprintf("%s/-/projects/%d", p.Owner.HomeLink(), p.ID)
}
if p.RepoID > 0 {
err := p.LoadRepo(db.DefaultContext)
@@ -131,7 +131,7 @@ func (p *Project) Link() string {
log.Error("LoadRepo: %v", err)
return ""
}
- return fmt.Sprintf("/%s/projects/%d", p.Repo.RepoPath(), p.ID)
+ return fmt.Sprintf("%s/projects/%d", p.Repo.Link(), p.ID)
}
return ""
}
diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go
index 3d70ca9a50..be60a0c73b 100644
--- a/routers/web/auth/oauth.go
+++ b/routers/web/auth/oauth.go
@@ -847,6 +847,11 @@ func SignInOAuth(ctx *context.Context) {
return
}
+ redirectTo := ctx.FormString("redirect_to")
+ if len(redirectTo) > 0 {
+ middleware.SetRedirectToCookie(ctx.Resp, redirectTo)
+ }
+
// try to do a direct callback flow, so we don't authenticate the user again but use the valid accesstoken to get the user
user, gothUser, err := oAuth2UserLoginCallback(authSource, ctx.Req, ctx.Resp)
if err == nil && user != nil {