@@ -62,23 +62,14 @@ func OAUTHRedirect(ctx fiber.Ctx) error {
6262 }
6363 models .SYSLOG .Tracef ("redirecting to /welcome.html?access_token=%v" , t .AccessToken )
6464 // return ctx.Redirect("/welcome.html?access_token="+t.AccessToken, fiber.StatusFound)
65- return func () {
66- __fiberRedirectTarget := "/welcome.html"
67- __fiberRedirectStatus := fiber .StatusFound
68- return ctx .Redirect ().Status (__fiberRedirectStatus ).To (__fiberRedirectTarget )
69- }()
65+ return ctx .Redirect ().Status (fiber .StatusFound ).To ("/welcome.html" )
7066 }
7167
7268 models .SYSLOG .Tracef ("redirecting to /" )
73- return func () {
74- __fiberRedirectTarget := "/"
75- __fiberRedirectStatus := fiber .StatusTemporaryRedirect
76- return ctx .Redirect ().Status (__fiberRedirectStatus ).To (__fiberRedirectTarget )
77-
78- // OAUTHProtected processes access attempts; if the session stored token is NULL then it sends to start page
79- }()
69+ return ctx .Redirect ().Status (fiber .StatusTemporaryRedirect ).To ("/" )
8070}
8171
72+ // OAUTHProtected processes access attempts; if the session stored token is NULL then it sends to start page
8273func OAUTHProtected (c fiber.Ctx ) error {
8374 models .SYSLOG .Tracef ("entering OAUTHProtected; original URL: %v" , c .OriginalURL ())
8475 defer models .SYSLOG .Trace ("exiting OAUTHProtected" )
@@ -106,11 +97,7 @@ func OAUTHProtected(c fiber.Ctx) error {
10697 if tk == nil {
10798 sessData .Destroy ()
10899 models .SYSLOG .Tracef ("token is NULL" )
109- return func () {
110- __fiberRedirectTarget := "/index.html"
111- __fiberRedirectStatus := fiber .StatusTemporaryRedirect
112- return c .Redirect ().Status (__fiberRedirectStatus ).To (__fiberRedirectTarget )
113- }()
100+ return c .Redirect ().Status (fiber .StatusTemporaryRedirect ).To ("/index.html" )
114101 }
115102
116103 return c .Next ()
@@ -149,9 +136,5 @@ func OAUTHDisconnect(c fiber.Ctx) error {
149136
150137 sessData .Destroy ()
151138
152- return func () {
153- __fiberRedirectTarget := "/index.html"
154- __fiberRedirectStatus := fiber .StatusTemporaryRedirect
155- return c .Redirect ().Status (__fiberRedirectStatus ).To (__fiberRedirectTarget )
156- }()
139+ return c .Redirect ().Status (fiber .StatusTemporaryRedirect ).To ("/index.html" )
157140}
0 commit comments