mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Do not strip nodekey prefix on handle expired
This commit is contained in:
		
							parent
							
								
									c5ba7552c5
								
							
						
					
					
						commit
						275cc28193
					
				@ -490,6 +490,7 @@ func (h *Headscale) handleNewMachineCommon(
 | 
				
			|||||||
		Bool("noise", machineKey.IsZero()).
 | 
							Bool("noise", machineKey.IsZero()).
 | 
				
			||||||
		Str("machine", registerRequest.Hostinfo.Hostname).
 | 
							Str("machine", registerRequest.Hostinfo.Hostname).
 | 
				
			||||||
		Msg("The node seems to be new, sending auth url")
 | 
							Msg("The node seems to be new, sending auth url")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if h.oauth2Config != nil {
 | 
						if h.oauth2Config != nil {
 | 
				
			||||||
		resp.AuthURL = fmt.Sprintf(
 | 
							resp.AuthURL = fmt.Sprintf(
 | 
				
			||||||
			"%s/oidc/register/%s",
 | 
								"%s/oidc/register/%s",
 | 
				
			||||||
@ -727,7 +728,7 @@ func (h *Headscale) handleMachineExpiredCommon(
 | 
				
			|||||||
	if h.oauth2Config != nil {
 | 
						if h.oauth2Config != nil {
 | 
				
			||||||
		resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s",
 | 
							resp.AuthURL = fmt.Sprintf("%s/oidc/register/%s",
 | 
				
			||||||
			strings.TrimSuffix(h.cfg.ServerURL, "/"),
 | 
								strings.TrimSuffix(h.cfg.ServerURL, "/"),
 | 
				
			||||||
			NodePublicKeyStripPrefix(registerRequest.NodeKey))
 | 
								registerRequest.NodeKey)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		resp.AuthURL = fmt.Sprintf("%s/register/%s",
 | 
							resp.AuthURL = fmt.Sprintf("%s/register/%s",
 | 
				
			||||||
			strings.TrimSuffix(h.cfg.ServerURL, "/"),
 | 
								strings.TrimSuffix(h.cfg.ServerURL, "/"),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user