File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments