IsAuthenticated checks if there are valid credentials.
()
| 121 | |
| 122 | // IsAuthenticated checks if there are valid credentials. |
| 123 | func (m *Manager) IsAuthenticated() bool { |
| 124 | if os.Getenv("HEY_TOKEN") != "" { |
| 125 | return true |
| 126 | } |
| 127 | |
| 128 | creds, err := m.store.Load(m.baseURL) |
| 129 | if err != nil { |
| 130 | return false |
| 131 | } |
| 132 | return creds.AccessToken != "" || creds.SessionCookie != "" |
| 133 | } |
| 134 | |
| 135 | // LoginOptions configures the login flow. |
| 136 | type LoginOptions struct { |