summaryrefslogtreecommitdiff
path: root/internal/oauth.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-26 15:49:31 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-26 15:49:31 +0200
commit5608d9a858c2323002305ea1fedb5793a40edc58 (patch)
tree51b5152d0f6724ca663c714d00e8c43abd9888f9 /internal/oauth.go
parent75aa163ccf407e9690f9ea0e548f8fed70073722 (diff)
Refactor: Authenticated -> Authorized
Diffstat (limited to 'internal/oauth.go')
-rw-r--r--internal/oauth.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/oauth.go b/internal/oauth.go
index a49b492..9d17777 100644
--- a/internal/oauth.go
+++ b/internal/oauth.go
@@ -84,7 +84,7 @@ type OAuthToken struct {
ExpiredTimestamp int64 `json:"expires_in_timestamp"`
}
-// Gets an authenticated HTTP client by obtaining refresh and access tokens
+// Gets an authorized HTTP client by obtaining refresh and access tokens
func (oauth *OAuth) getTokensWithCallback() error {
oauth.Session.Context = context.Background()
mux := http.NewServeMux()
@@ -267,7 +267,7 @@ func (oauth *OAuth) start(name string, authorizationURL string, tokenURL string)
// Error definitions
func (oauth *OAuth) Finish() error {
- if !oauth.FSM.HasTransition(AUTHENTICATED) {
+ if !oauth.FSM.HasTransition(AUTHORIZED) {
return errors.New("invalid state to finish oauth")
}
tokenErr := oauth.getTokensWithCallback()
@@ -275,7 +275,7 @@ func (oauth *OAuth) Finish() error {
if tokenErr != nil {
return tokenErr
}
- oauth.FSM.GoTransition(AUTHENTICATED)
+ oauth.FSM.GoTransition(AUTHORIZED)
return nil
}