mirror of https://github.com/h44z/wg-portal.git
				
				
				
			fix issue where newly created peers expire
This commit is contained in:
		
							parent
							
								
									2796433973
								
							
						
					
					
						commit
						e97fb38bd5
					
				|  | @ -120,6 +120,9 @@ func (s *Server) CreatePeer(device string, peer wireguard.Peer) error { | |||
| 	} | ||||
| 	peer.DeviceName = dev.DeviceName | ||||
| 	peer.UID = fmt.Sprintf("u%x", md5.Sum([]byte(peer.PublicKey))) | ||||
| 	if peer.ExpiresAt != nil && peer.ExpiresAt.IsZero() { // convert 01-01-0001 to nil
 | ||||
| 		peer.ExpiresAt = nil | ||||
| 	} | ||||
| 
 | ||||
| 	// Create WireGuard interface
 | ||||
| 	if peer.DeactivatedAt == nil { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue