Browse Source

Updated All Links for new auth

Yoginth 7 years ago
parent
commit
3581d5b38d

+ 2 - 2
pkg/context/auth.go

@@ -65,7 +65,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 				}
 				}
 
 
 				c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
 				c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
-				c.Redirect(setting.AppSubURL + "/user/login")
+				c.Redirect(setting.AppSubURL + "/login")
 				return
 				return
 			} else if !c.User.IsActive && setting.Service.RegisterEmailConfirm {
 			} else if !c.User.IsActive && setting.Service.RegisterEmailConfirm {
 				c.Data["Title"] = c.Tr("auth.active_your_account")
 				c.Data["Title"] = c.Tr("auth.active_your_account")
@@ -78,7 +78,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 		if !options.SignOutRequired && !c.IsLogged && !auth.IsAPIPath(c.Req.URL.Path) &&
 		if !options.SignOutRequired && !c.IsLogged && !auth.IsAPIPath(c.Req.URL.Path) &&
 			len(c.GetCookie(setting.CookieUserName)) > 0 {
 			len(c.GetCookie(setting.CookieUserName)) > 0 {
 			c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
 			c.SetCookie("redirect_to", url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
-			c.Redirect(setting.AppSubURL + "/user/login")
+			c.Redirect(setting.AppSubURL + "/login")
 			return
 			return
 		}
 		}
 
 

+ 1 - 1
public/css/gitote.css

@@ -632,7 +632,7 @@ footer .ui.language .menu {
   .ui.form .inline.fields .field > :first-child {
   .ui.form .inline.fields .field > :first-child {
     text-align: left;
     text-align: left;
   }
   }
-  .inline.field a[href^="/user/sign_up"] {
+  .inline.field a[href^="/join"] {
     white-space: nowrap;
     white-space: nowrap;
   }
   }
   .ui.form .field:last-child,
   .ui.form .field:last-child,

+ 1 - 1
public/less/_base.less

@@ -705,7 +705,7 @@ footer {
 		text-align: left;
 		text-align: left;
 	}
 	}
 
 
-	.inline.field a[href^="/user/sign_up"]{
+	.inline.field a[href^="/join"]{
 		white-space: nowrap;
 		white-space: nowrap;
 	}
 	}
 
 

+ 2 - 2
public/sitemap.xml

@@ -81,12 +81,12 @@
         <priority>0.9</priority>
         <priority>0.9</priority>
     </url>
     </url>
     <url>
     <url>
-        <loc>https://gitote.in/user/login</loc>
+        <loc>https://gitote.in/login</loc>
         <changefreq>Daily</changefreq>
         <changefreq>Daily</changefreq>
         <priority>0.9</priority>
         <priority>0.9</priority>
     </url>
     </url>
     <url>
     <url>
-        <loc>https://gitote.in/user/sign_up</loc>
+        <loc>https://gitote.in/join</loc>
         <changefreq>Daily</changefreq>
         <changefreq>Daily</changefreq>
         <priority>0.9</priority>
         <priority>0.9</priority>
     </url>
     </url>

+ 1 - 1
routes/home.go

@@ -32,7 +32,7 @@ func Home(c *context.Context) {
 	// Check auto-login.
 	// Check auto-login.
 	uname := c.GetCookie(setting.CookieUserName)
 	uname := c.GetCookie(setting.CookieUserName)
 	if len(uname) != 0 {
 	if len(uname) != 0 {
-		c.Redirect(setting.AppSubURL + "/user/login")
+		c.Redirect(setting.AppSubURL + "/login")
 		return
 		return
 	}
 	}
 
 

+ 1 - 1
routes/install.go

@@ -393,5 +393,5 @@ func InstallPost(c *context.Context, f form.Install) {
 
 
 	log.Info("First-time run install finished!")
 	log.Info("First-time run install finished!")
 	c.Flash.Success(c.Tr("install.install_success"))
 	c.Flash.Success(c.Tr("install.install_success"))
-	c.Redirect(f.AppUrl + "user/login")
+	c.Redirect(f.AppUrl + "login")
 }
 }

+ 2 - 2
routes/repo/issue.go

@@ -114,7 +114,7 @@ func issues(c *context.Context, isPullList bool) {
 	// Must sign in to see issues about you.
 	// Must sign in to see issues about you.
 	if viewType != "all" && !c.IsLogged {
 	if viewType != "all" && !c.IsLogged {
 		c.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
 		c.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+c.Req.RequestURI), 0, setting.AppSubURL)
-		c.Redirect(setting.AppSubURL + "/user/login")
+		c.Redirect(setting.AppSubURL + "/login")
 		return
 		return
 	}
 	}
 
 
@@ -664,7 +664,7 @@ func viewIssue(c *context.Context, isPullList bool) {
 	c.Data["NumParticipants"] = len(participants)
 	c.Data["NumParticipants"] = len(participants)
 	c.Data["Issue"] = issue
 	c.Data["Issue"] = issue
 	c.Data["IsIssueOwner"] = c.Repo.IsWriter() || (c.IsLogged && issue.IsPoster(c.User.ID))
 	c.Data["IsIssueOwner"] = c.Repo.IsWriter() || (c.IsLogged && issue.IsPoster(c.User.ID))
-	c.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + c.Data["Link"].(string)
+	c.Data["SignInLink"] = setting.AppSubURL + "/login?redirect_to=" + c.Data["Link"].(string)
 	c.HTML(200, ISSUE_VIEW)
 	c.HTML(200, ISSUE_VIEW)
 }
 }
 
 

+ 6 - 6
routes/user/auth.go

@@ -193,7 +193,7 @@ func LoginPost(c *context.Context, f form.SignIn) {
 
 
 	c.Session.Set("twoFactorRemember", f.Remember)
 	c.Session.Set("twoFactorRemember", f.Remember)
 	c.Session.Set("twoFactorUserID", u.ID)
 	c.Session.Set("twoFactorUserID", u.ID)
-	c.SubURLRedirect("/user/login/two_factor")
+	c.SubURLRedirect("/login/two_factor")
 }
 }
 
 
 func LoginTwoFactor(c *context.Context) {
 func LoginTwoFactor(c *context.Context) {
@@ -226,7 +226,7 @@ func LoginTwoFactorPost(c *context.Context) {
 		return
 		return
 	} else if !valid {
 	} else if !valid {
 		c.Flash.Error(c.Tr("settings.two_factor_invalid_passcode"))
 		c.Flash.Error(c.Tr("settings.two_factor_invalid_passcode"))
-		c.SubURLRedirect("/user/login/two_factor")
+		c.SubURLRedirect("/login/two_factor")
 		return
 		return
 	}
 	}
 
 
@@ -239,7 +239,7 @@ func LoginTwoFactorPost(c *context.Context) {
 	// Prevent same passcode from being reused
 	// Prevent same passcode from being reused
 	if c.Cache.IsExist(u.TwoFactorCacheKey(passcode)) {
 	if c.Cache.IsExist(u.TwoFactorCacheKey(passcode)) {
 		c.Flash.Error(c.Tr("settings.two_factor_reused_passcode"))
 		c.Flash.Error(c.Tr("settings.two_factor_reused_passcode"))
-		c.SubURLRedirect("/user/login/two_factor")
+		c.SubURLRedirect("/login/two_factor")
 		return
 		return
 	}
 	}
 	if err = c.Cache.Put(u.TwoFactorCacheKey(passcode), 1, 60); err != nil {
 	if err = c.Cache.Put(u.TwoFactorCacheKey(passcode), 1, 60); err != nil {
@@ -269,7 +269,7 @@ func LoginTwoFactorRecoveryCodePost(c *context.Context) {
 	if err := models.UseRecoveryCode(userID, c.Query("recovery_code")); err != nil {
 	if err := models.UseRecoveryCode(userID, c.Query("recovery_code")); err != nil {
 		if errors.IsTwoFactorRecoveryCodeNotFound(err) {
 		if errors.IsTwoFactorRecoveryCodeNotFound(err) {
 			c.Flash.Error(c.Tr("auth.login_two_factor_invalid_recovery_code"))
 			c.Flash.Error(c.Tr("auth.login_two_factor_invalid_recovery_code"))
-			c.SubURLRedirect("/user/login/two_factor_recovery_code")
+			c.SubURLRedirect("/login/two_factor_recovery_code")
 		} else {
 		} else {
 			c.ServerError("UseRecoveryCode", err)
 			c.ServerError("UseRecoveryCode", err)
 		}
 		}
@@ -390,7 +390,7 @@ func SignUpPost(c *context.Context, cpt *captcha.Captcha, f form.Register) {
 		return
 		return
 	}
 	}
 
 
-	c.SubURLRedirect("/user/login")
+	c.SubURLRedirect("/login")
 }
 }
 
 
 func Activate(c *context.Context) {
 func Activate(c *context.Context) {
@@ -573,7 +573,7 @@ func ResetPasswdPost(c *context.Context) {
 		}
 		}
 
 
 		log.Trace("User password reset: %s", u.Name)
 		log.Trace("User password reset: %s", u.Name)
-		c.SubURLRedirect("/user/login")
+		c.SubURLRedirect("/login")
 		return
 		return
 	}
 	}
 
 

+ 2 - 2
templates/base/head.tmpl

@@ -311,11 +311,11 @@
 								{{else}}
 								{{else}}
 
 
 									<div class="right menu hide-mobile">
 									<div class="right menu hide-mobile">
-										<a class="navbar bold home-main btn signin main-menu item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubURL}}/user/login?redirect_to={{.Link}}">
+										<a class="navbar bold home-main btn signin main-menu item{{if .PageIsSignIn}} active{{end}}" href="{{AppSubURL}}/login?redirect_to={{.Link}}">
 											<i class="menu-icon octicon octicon">🔑</i> {{.i18n.Tr "sign_in"}}
 											<i class="menu-icon octicon octicon">🔑</i> {{.i18n.Tr "sign_in"}}
 										</a>
 										</a>
 										{{if .ShowRegistrationButton}}
 										{{if .ShowRegistrationButton}}
-											<a class="navbar bold home-main btn register main-menu item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubURL}}/user/sign_up">
+											<a class="navbar bold home-main btn register main-menu item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubURL}}/join">
 												<i class="menu-icon octicon">➕ </i> {{.i18n.Tr "register"}}
 												<i class="menu-icon octicon">➕ </i> {{.i18n.Tr "register"}}
 											</a>
 											</a>
 										{{end}}
 										{{end}}

+ 4 - 4
templates/home.tmpl

@@ -12,13 +12,13 @@
 					</h1>
 					</h1>
 					<h2>{{.i18n.Tr "app_desc"}}</h2>
 					<h2>{{.i18n.Tr "app_desc"}}</h2>
 					<h3 class="desc">{{AppName}} is one of the code hosts in the world with many projects. Private, public, or open source, all repositories are equipped with tools to help you host, version, and release code.</h3>
 					<h3 class="desc">{{AppName}} is one of the code hosts in the world with many projects. Private, public, or open source, all repositories are equipped with tools to help you host, version, and release code.</h3>
-					<a href="{{AppURL}}user/login">
+					<a href="{{AppURL}}login">
 						<button class="ui green button home-main home btn">
 						<button class="ui green button home-main home btn">
 							🔑 Sign in
 							🔑 Sign in
 						</button>
 						</button>
 					</a>
 					</a>
 					{{if .ShowRegistrationButton}}
 					{{if .ShowRegistrationButton}}
-					<a href="{{AppURL}}user/sign_up">
+					<a href="{{AppURL}}join">
 						<button class="ui blue button home-main home btn">
 						<button class="ui blue button home-main home btn">
 							➕ Create Account
 							➕ Create Account
 						</button>
 						</button>
@@ -83,7 +83,7 @@
 			<div class="ui stackable center aligned vertically padded grid">
 			<div class="ui stackable center aligned vertically padded grid">
 				<div class="eight wide column">
 				<div class="eight wide column">
 					<p>{{AppName}} brings teams together to work through problems, move ideas forward, and learn from each other along the way.</p>
 					<p>{{AppName}} brings teams together to work through problems, move ideas forward, and learn from each other along the way.</p>
-					<a class="ui large green basic button" href="{{AppURL}}user/sign_up">
+					<a class="ui large green basic button" href="{{AppURL}}join">
 						Sign up your team
 						Sign up your team
 						<i class="right chevron icon"></i>
 						<i class="right chevron icon"></i>
 					</a>
 					</a>
@@ -99,7 +99,7 @@
 			<h1 class="ui header">
 			<h1 class="ui header">
 				Get started for free — join with developers already using {{AppName}} to share their code, work together, and build amazing things.
 				Get started for free — join with developers already using {{AppName}} to share their code, work together, and build amazing things.
 			</h1>
 			</h1>
-			<a class="ui positive huge button" href="{{AppURL}}user/sign_up">
+			<a class="ui positive huge button" href="{{AppURL}}join">
 				Register
 				Register
 			</a>
 			</a>
 		</div>
 		</div>

+ 1 - 1
templates/mail/auth/register_notify.tmpl

@@ -8,7 +8,7 @@
 <body>
 <body>
 	<p>Hi <b>{{.Username}}</b>, this is your registration confirmation email for {{AppName}}!</p>
 	<p>Hi <b>{{.Username}}</b>, this is your registration confirmation email for {{AppName}}!</p>
 	<p>You can now login via username: {{.Username}}.</p>
 	<p>You can now login via username: {{.Username}}.</p>
-	<p><a href="{{AppURL}}user/login">{{AppURL}}user/login</a></p>
+	<p><a href="{{AppURL}}login">{{AppURL}}login</a></p>
 	<p>© 2018 <a target="_blank" rel="noopener noreferrer" href="{{AppURL}}">{{AppName}}</a></p>
 	<p>© 2018 <a target="_blank" rel="noopener noreferrer" href="{{AppURL}}">{{AppName}}</a></p>
 </body>
 </body>
 </html>
 </html>

+ 1 - 1
templates/misc/signup_prompt.tmpl

@@ -25,7 +25,7 @@
         {{end}}
         {{end}}
     </h5>
     </h5>
     <div class="ui center aligned header">
     <div class="ui center aligned header">
-        <a class="ui green button" href="{{AppURL}}user/sign_up">
+        <a class="ui green button" href="{{AppURL}}join">
             Sign up
             Sign up
         </a>
         </a>
     </div>
     </div>

+ 1 - 1
templates/user/auth/login.tmpl

@@ -68,7 +68,7 @@
 					{{if .ShowRegistrationButton}}
 					{{if .ShowRegistrationButton}}
 						<div class="inline field">
 						<div class="inline field">
 							<label></label>
 							<label></label>
-							<a href="{{AppSubURL}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
+							<a href="{{AppSubURL}}/join">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
 						</div>
 						</div>
 					{{end}}
 					{{end}}
 				</div>
 				</div>

+ 1 - 1
templates/user/auth/signup.tmpl

@@ -48,7 +48,7 @@
 						</div>
 						</div>
 						<div class="inline field">
 						<div class="inline field">
 							<label></label>
 							<label></label>
-							<a href="{{AppSubURL}}/user/login">{{.i18n.Tr "auth.register_hepler_msg"}}</a>
+							<a href="{{AppSubURL}}/login">{{.i18n.Tr "auth.register_hepler_msg"}}</a>
 						</div>
 						</div>
 					{{end}}
 					{{end}}
 				</div>
 				</div>

+ 1 - 1
templates/user/auth/two_factor.tmpl

@@ -22,7 +22,7 @@
 					<button class="ui fluid green button">{{.i18n.Tr "settings.two_factor_verify"}}</button>
 					<button class="ui fluid green button">{{.i18n.Tr "settings.two_factor_verify"}}</button>
 				</div>
 				</div>
 				<p class="ui center">
 				<p class="ui center">
-					<a href="{{AppSubURL}}/user/login/two_factor_recovery_code">{{.i18n.Tr "auth.login_two_factor_enter_recovery_code"}}</a>
+					<a href="{{AppSubURL}}/login/two_factor_recovery_code">{{.i18n.Tr "auth.login_two_factor_enter_recovery_code"}}</a>
 				</p>
 				</p>
 			</form>
 			</form>
 		</div>
 		</div>

+ 1 - 1
templates/user/auth/two_factor_recovery_code.tmpl

@@ -22,7 +22,7 @@
 					<button class="ui fluid green button">{{.i18n.Tr "settings.two_factor_verify"}}</button>
 					<button class="ui fluid green button">{{.i18n.Tr "settings.two_factor_verify"}}</button>
 				</div>
 				</div>
 				<p class="ui center">
 				<p class="ui center">
-					<a href="{{AppSubURL}}/user/login/two_factor">{{.i18n.Tr "auth.login_two_factor_enter_passcode"}}</a>
+					<a href="{{AppSubURL}}/login/two_factor">{{.i18n.Tr "auth.login_two_factor_enter_passcode"}}</a>
 				</p>
 				</p>
 			</form>
 			</form>
 		</div>
 		</div>

+ 1 - 1
templates/user/profile.tmpl

@@ -138,7 +138,7 @@
 							{{else}}
 							{{else}}
 								<li>
 								<li>
 									<i class="menu-icon octicon">📧</i>
 									<i class="menu-icon octicon">📧</i>
-									<a class="pro-truncate" href="{{AppURL}}user/login" rel="nofollow">Login to view email</a>
+									<a class="pro-truncate" href="{{AppURL}}login" rel="nofollow">Login to view email</a>
 								</li>
 								</li>
 							{{end}}
 							{{end}}
 							{{if .Owner.Website}}
 							{{if .Owner.Website}}