Skip to content

Commit d67722a

Browse files
committed
perform conditional redirect if its digger.dev
1 parent db8fae7 commit d67722a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

backend/controllers/web.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,17 @@ func (web *WebController) PolicyDetailsUpdatePage(c *gin.Context) {
295295

296296
func (web *WebController) RedirectToLoginSubdomain(context *gin.Context) {
297297
host := context.Request.Host
298-
hostParts := strings.Split(host, ".")
299-
if len(hostParts) > 2 {
300-
hostParts[0] = "login"
301-
host = strings.Join(hostParts, ".")
302-
}
303-
context.Redirect(http.StatusMovedPermanently, fmt.Sprintf("https://%s", host))
304-
}
298+
if strings.Contains(host, "digger.dev") || strings.Contains(host, "uselemon.cloud") {
299+
hostParts := strings.Split(host, ".")
300+
if len(hostParts) > 2 {
301+
hostParts[0] = "login"
302+
host = strings.Join(hostParts, ".")
303+
}
304+
context.Redirect(http.StatusMovedPermanently, fmt.Sprintf("https://%s", host))
305305

306-
func (web *WebController) RedirectToProjectsPage(context *gin.Context) {
307-
context.Redirect(http.StatusMovedPermanently, "/projects")
306+
} else {
307+
context.Redirect(http.StatusMovedPermanently, "/projects")
308+
}
308309
}
309310

310311
func (web *WebController) UpdateRepoPage(c *gin.Context) {

0 commit comments

Comments
 (0)