-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(account): add login command #375
base: main
Are you sure you want to change the base?
Conversation
kangasta
commented
Feb 11, 2025
- Sync with feat(config): added initial keyring support (#83) #350
- Wait for hub support
|
||
exec.PushProgressSuccess(msg) | ||
|
||
return output.None{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should maybe output the token if saving to keyring fails 🤔
return commands.HandleError(exec, msg, fmt.Errorf("failed to save token to keyring: %w", err)) | ||
} | ||
|
||
exec.PushProgressSuccess(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update progress message to something like New authentication token created and saved to system keyring.
|
||
err = keyring.Set("UpCloud", "", token) | ||
if err != nil { | ||
return commands.HandleError(exec, msg, fmt.Errorf("failed to save token to keyring: %w", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to use config file as fallback? I guess the file should be generic to be able to use it also with e.g. Terraform provider 🤔
if token == "" { | ||
http.Redirect(w, req, getURL("error"), http.StatusSeeOther) | ||
return | ||
} | ||
s.token = token | ||
http.Redirect(w, req, getURL("success"), http.StatusSeeOther) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the token be delivered with fetch request instead of redirects?