mirror of
https://github.com/openziti/zrok.git
synced 2025-06-13 21:37:01 +02:00
Remove old hardcoded domain
This commit is contained in:
parent
ec73d03078
commit
b951ea152d
@ -167,7 +167,7 @@ func configureGithubOauth(cfg *OauthConfig, tls bool) error {
|
|||||||
authCheckInterval = i
|
authCheckInterval = i
|
||||||
}
|
}
|
||||||
|
|
||||||
SetZrokCookie(w, primaryEmail, tokens.AccessToken, "github", authCheckInterval, key)
|
SetZrokCookie(w, domain, primaryEmail, tokens.AccessToken, "github", authCheckInterval, key)
|
||||||
http.Redirect(w, r, fmt.Sprintf("%s://%s", scheme, token.Claims.(*IntermediateJWT).Host), http.StatusFound)
|
http.Redirect(w, r, fmt.Sprintf("%s://%s", scheme, token.Claims.(*IntermediateJWT).Host), http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ func configureGoogleOauth(cfg *OauthConfig, tls bool) error {
|
|||||||
authCheckInterval = i
|
authCheckInterval = i
|
||||||
}
|
}
|
||||||
|
|
||||||
SetZrokCookie(w, rDat.Email, tokens.AccessToken, "google", authCheckInterval, key)
|
SetZrokCookie(w, domain, rDat.Email, tokens.AccessToken, "google", authCheckInterval, key)
|
||||||
http.Redirect(w, r, fmt.Sprintf("%s://%s", scheme, token.Claims.(*IntermediateJWT).Host), http.StatusFound)
|
http.Redirect(w, r, fmt.Sprintf("%s://%s", scheme, token.Claims.(*IntermediateJWT).Host), http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ type ZrokClaims struct {
|
|||||||
jwt.RegisteredClaims
|
jwt.RegisteredClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetZrokCookie(w http.ResponseWriter, email, accessToken, provider string, checkInterval time.Duration, key []byte) {
|
func SetZrokCookie(w http.ResponseWriter, domain, email, accessToken, provider string, checkInterval time.Duration, key []byte) {
|
||||||
tkn := jwt.NewWithClaims(jwt.SigningMethodHS256, ZrokClaims{
|
tkn := jwt.NewWithClaims(jwt.SigningMethodHS256, ZrokClaims{
|
||||||
Email: email,
|
Email: email,
|
||||||
AccessToken: accessToken,
|
AccessToken: accessToken,
|
||||||
@ -333,7 +333,7 @@ func SetZrokCookie(w http.ResponseWriter, email, accessToken, provider string, c
|
|||||||
Name: "zrok-access",
|
Name: "zrok-access",
|
||||||
Value: sTkn,
|
Value: sTkn,
|
||||||
MaxAge: int(checkInterval.Seconds()),
|
MaxAge: int(checkInterval.Seconds()),
|
||||||
Domain: "localzrok.io",
|
Domain: domain,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
Expires: time.Now().Add(checkInterval),
|
Expires: time.Now().Add(checkInterval),
|
||||||
//Secure: true, //When tls gets added have this be configured on if tls
|
//Secure: true, //When tls gets added have this be configured on if tls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user