File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ FROM alpine:latest
2424WORKDIR /root/
2525RUN mkdir app dashboard
2626COPY --from=node-builder /authorizer/app/build app/build
27+ COPY --from=node-builder /authorizer/app/favicon_io app/favicon_io
2728COPY --from=node-builder /authorizer/dashboard/build dashboard/build
29+ COPY --from=node-builder /authorizer/dashboard/favicon_io dashboard/favicon_io
2830COPY --from=go-builder /authorizer/build build
2931COPY templates templates
3032EXPOSE 8080
Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ const Dashboard = lazy(() => import('./pages/dashboard'));
99export default function Root ( ) {
1010 const { token, loading, config } = useAuthorizer ( ) ;
1111
12+ console . log ( config ) ;
1213 useEffect ( ( ) => {
1314 if ( token ) {
1415 const url = new URL ( config . redirectURL || '/app' ) ;
16+ console . log ( '=> url' , url ) ;
1517 if ( url . origin !== window . location . origin ) {
1618 window . location . href = config . redirectURL || '/app' ;
1719 }
Original file line number Diff line number Diff line change @@ -33,10 +33,8 @@ func AppHandler() gin.HandlerFunc {
3333 var stateObj State
3434
3535 if state == "" {
36-
3736 stateObj .AuthorizerURL = hostname
38- stateObj .RedirectURL = stateObj .AuthorizerURL + "/app"
39-
37+ stateObj .RedirectURL = hostname + "/app"
4038 } else {
4139 decodedState , err := utils .DecryptB64 (state )
4240 if err != nil {
Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ import (
1010
1111// GetHost returns hostname from request context
1212func GetHost (c * gin.Context ) string {
13- scheme := "http"
14- if c . Request . TLS != nil {
15- scheme = "https "
13+ scheme := c . Request . Header . Get ( "X-Forwarded-Proto" )
14+ if scheme != "https" {
15+ scheme = "http "
1616 }
17- log .Println ("=> url:" , scheme + "://" + c .Request .Host )
18- return scheme + "://" + c .Request .Host
17+ host := c .Request .Host
18+ log .Println ("=> host:" , scheme + "://" + host )
19+ return scheme + "://" + host
1920}
2021
2122// GetHostName function returns hostname and port
You can’t perform that action at this time.
0 commit comments