Use oidc if it initialised, not if it is configured
OIDC might be configured, but unable to be initialised, this only runs the oidc cycle if it is actually successfully set up/initialised. Prep for next commit Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
a507a04650
commit
8dcc82ceb3
1 changed files with 2 additions and 2 deletions
|
@ -483,7 +483,7 @@ func (h *Headscale) handleNewMachineCommon(
|
|||
Bool("noise", machineKey.IsZero()).
|
||||
Str("machine", registerRequest.Hostinfo.Hostname).
|
||||
Msg("The node seems to be new, sending auth url")
|
||||
if h.cfg.OIDC.Issuer != "" {
|
||||
if h.oauth2Config != nil {
|
||||
resp.AuthURL = fmt.Sprintf(
|
||||
"%s/oidc/register/%s",
|
||||
strings.TrimSuffix(h.cfg.ServerURL, "/"),
|
||||
|
@ -716,7 +716,7 @@ func (h *Headscale) handleMachineExpiredCommon(
|
|||
return
|
||||
}
|
||||
|
||||
if h.cfg.OIDC.Issuer != "" {
|
||||
if h.oauth2Config != nil {
|
||||
resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s",
|
||||
strings.TrimSuffix(h.cfg.ServerURL, "/"),
|
||||
NodePublicKeyStripPrefix(registerRequest.NodeKey))
|
||||
|
|
Loading…
Reference in a new issue