// printAuthURLLoop loops once every few seconds while the server is still running and
// is in NeedsLogin state, printing out the auth URL.
printAuthURLLoop loops once every few seconds while the server is still running and
is in NeedsLogin state, printing out the auth URL.
// printAuthURLLoop loops once every few seconds while the server is still running and // is in NeedsLogin state printing out the auth URL .
func (s *Server) printAuthURLLoop() {
	for {
		if s.shutdownCtx.Err() != nil {
			return
		}
		if st := s.lb.State(); st != ipn.NeedsLogin {
			s.logf("printAuthURLLoop: state is %v; stopping", st)
			return
		}
		st := s.lb.StatusWithoutPeers()
		if st.AuthURL != "" {
			s.logf("To start this tsnet server, restart with TS_AUTHKEY set, or go to: %s", st.AuthURL)
		}
		select {
		case <-time.After(5 * time.Second):
		case <-s.shutdownCtx.Done():
			return
		}
	}
}
func ( s * Server ) printAuthURLLoop ( ) { for { if s . shutdownCtx . Err ( ) != nil { return } if st := s . lb . State ( ) ; st != ipn . NeedsLogin { s . logf ( " " , st ) return } st := s . lb . StatusWithoutPeers ( ) if st . AuthURL != " " { s . logf ( " " , st . AuthURL ) } select { case <- time . After ( 5 * time . Second ) : case <- s . shutdownCtx . Done ( ) : return } } }
printAuthURLLoop loops once every few seconds while the server is still running and
is in NeedsLogin state, printing out the auth URL.
printAuthURLLoop loops once every few seconds while the server is still running and is in NeedsLogin state printing out the auth URL .