summaryrefslogtreecommitdiff
path: root/src/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.go')
-rw-r--r--src/server.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/server.go b/src/server.go
index b7d55cb..7e323f6 100644
--- a/src/server.go
+++ b/src/server.go
@@ -6,11 +6,11 @@ import (
)
type Server struct {
- BaseURL string `json:"base_url"`
- Endpoints *ServerEndpoints `json:"endpoints"`
- OAuth *OAuth `json:"oauth"`
- Profiles *ServerProfileInfo `json:"profiles"`
- ProfilesRaw string `json:"profiles_raw"`
+ BaseURL string `json:"base_url"`
+ Endpoints ServerEndpoints `json:"endpoints"`
+ OAuth OAuth `json:"oauth"`
+ Profiles ServerProfileInfo `json:"profiles"`
+ ProfilesRaw string `json:"profiles_raw"`
}
type ServerProfile struct {
@@ -56,12 +56,7 @@ func (server *Server) Initialize(url string) error {
}
func (server *Server) NeedsRelogin() bool {
- // Server has no oauth tokens
- if server.OAuth == nil || server.OAuth.Token == nil {
- return true
- }
-
- // Server has oauth tokens, check if they need a relogin
+ // Check if OAuth needs relogin
return server.OAuth.NeedsRelogin()
}
@@ -73,7 +68,7 @@ func (server *Server) GetEndpoints() error {
return bodyErr
}
- endpoints := &ServerEndpoints{}
+ endpoints := ServerEndpoints{}
jsonErr := json.Unmarshal(body, &endpoints)
if jsonErr != nil {