mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
Enhance authentication UX (#3807)
This commit is contained in:
@@ -100,16 +100,7 @@ func (c *client) URL() string {
|
||||
// Login authenticates the session and returns the forge user details.
|
||||
func (c *client) Login(ctx context.Context, req *forge_types.OAuthRequest) (*model.User, string, error) {
|
||||
config := c.newConfig()
|
||||
redirectURL := config.AuthCodeURL("woodpecker")
|
||||
|
||||
// check the OAuth errors
|
||||
if req.Error != "" {
|
||||
return nil, redirectURL, &forge_types.AuthError{
|
||||
Err: req.Error,
|
||||
Description: req.ErrorDescription,
|
||||
URI: req.ErrorURI,
|
||||
}
|
||||
}
|
||||
redirectURL := config.AuthCodeURL(req.State)
|
||||
|
||||
// check the OAuth code
|
||||
if len(req.Code) == 0 {
|
||||
@@ -662,9 +653,6 @@ func (c *client) getTagCommitSHA(ctx context.Context, repo *model.Repo, tagName
|
||||
}
|
||||
|
||||
gh := c.newClientToken(ctx, user.Token)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
page := 1
|
||||
var tag *github.RepositoryTag
|
||||
|
||||
Reference in New Issue
Block a user