Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

kangasta
Copy link
Contributor

@kangasta kangasta requested a review from a team as a code owner February 11, 2025 21:15
@kangasta kangasta marked this pull request as draft February 11, 2025 21:18

exec.PushProgressSuccess(msg)

return output.None{}, nil
Copy link
Contributor Author

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)
Copy link
Contributor Author

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))
Copy link
Contributor Author

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 🤔

Comment on lines +40 to +45
if token == "" {
http.Redirect(w, req, getURL("error"), http.StatusSeeOther)
return
}
s.token = token
http.Redirect(w, req, getURL("success"), http.StatusSeeOther)
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant