Skip to content

Commit b8b0169

Browse files
authored
fix(auth): set organisation from job token when present (#1934)
* fix(auth): set organisation from job token when present
1 parent 465edae commit b8b0169

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/middleware/basic.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ func HttpBasicApiAuth() gin.HandlerFunc {
6868
c.Abort()
6969
return
7070
} else {
71-
setDefaultOrganisationId(c)
71+
c.Set(ORGANISATION_ID_KEY, jobToken.OrganisationID)
7272
c.Set(ACCESS_LEVEL_KEY, jobToken.Type)
7373
c.Set(JOB_TOKEN_KEY, jobToken.Value)
74+
slog.Debug("Job token verified", "organisationId", jobToken.OrganisationID, "accessLevel", jobToken.Type)
75+
c.Next()
7476
}
7577
} else if token == os.Getenv("BEARER_AUTH_TOKEN") {
7678
slog.Debug("Using admin bearer token")

0 commit comments

Comments
 (0)