Skip to content

Commit ce464f4

Browse files
committed
fixes
1 parent 90e6488 commit ce464f4

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

api/v1/auth/auth.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func ApplyRoutes(r *gin.RouterGroup) {
2828
g.POST("/login", login)
2929
g.GET("/user", user)
3030
g.GET("/logout", logout)
31+
g.GET("/redirect", redirect)
3132
}
3233
}
3334

@@ -550,3 +551,17 @@ func user(c *gin.Context) {
550551

551552
c.AbortWithStatus(http.StatusUnauthorized)
552553
}
554+
555+
func redirect(c *gin.Context) {
556+
referer := os.Getenv("SERVER")
557+
558+
url := c.Request.URL.Query().Get("url")
559+
if url == "" {
560+
c.AbortWithStatus(http.StatusBadRequest)
561+
return
562+
}
563+
564+
url = url + "?referer=" + referer
565+
566+
c.Redirect(http.StatusTemporaryRedirect, url)
567+
}

ui/src/components/Services.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,10 @@ export default {
654654
this.wildServer = this.wildServer.slice(0, -1)
655655
}
656656
657-
this.TokenService.setWildServer(this.wildServer)
658-
this.wildServer = this.TokenService.getWildServer()
659-
660657
661658
this.dialogWilderness = false;
662-
663-
var url = this.wildServer + "/?referer=" + window.location.origin
664-
window.open( url )
659+
660+
window.location.replace( window.location.origin + "/api/v1.0/auth/redirect?url=" + this.wildServer)
665661
},
666662
667663
async createWilderness() {

0 commit comments

Comments
 (0)