mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 14:55:58 +00:00
Rename remote
to forge
(#1357)
As of #745 Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -21,9 +21,9 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/woodpecker-ci/woodpecker/server"
|
||||
"github.com/woodpecker-ci/woodpecker/server/forge"
|
||||
"github.com/woodpecker-ci/woodpecker/server/model"
|
||||
"github.com/woodpecker-ci/woodpecker/server/pipeline"
|
||||
"github.com/woodpecker-ci/woodpecker/server/remote"
|
||||
"github.com/woodpecker-ci/woodpecker/server/store"
|
||||
)
|
||||
|
||||
@@ -39,12 +39,12 @@ func handlePipelineErr(c *gin.Context, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// if the remote has a refresh token, the current access token may be stale.
|
||||
// if the forge has a refresh token, the current access token may be stale.
|
||||
// Therefore, we should refresh prior to dispatching the job.
|
||||
func refreshUserToken(c *gin.Context, user *model.User) {
|
||||
_remote := server.Config.Services.Remote
|
||||
_forge := server.Config.Services.Forge
|
||||
_store := store.FromContext(c)
|
||||
if refresher, ok := _remote.(remote.Refresher); ok {
|
||||
if refresher, ok := _forge.(forge.Refresher); ok {
|
||||
ok, err := refresher.Refresh(c, user)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("refresh oauth token of user '%s' failed", user.Login)
|
||||
|
Reference in New Issue
Block a user