mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
Enhance authentication UX (#3807)
This commit is contained in:
@@ -111,16 +111,7 @@ func (c *Forgejo) oauth2Config(ctx context.Context) (*oauth2.Config, context.Con
|
||||
// Forgejo account details are returned when the user is successfully authenticated.
|
||||
func (c *Forgejo) Login(ctx context.Context, req *forge_types.OAuthRequest) (*model.User, string, error) {
|
||||
config, oauth2Ctx := c.oauth2Config(ctx)
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user