Skip to content

Commit 9faf9ad

Browse files
committed
fix: /api/packages
1 parent 8f7c1ee commit 9faf9ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

routers/api/packages/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ func CommonRoutes() *web.Route {
101101
r.Use(context.PackageContexter())
102102

103103
verifyAuth(r, []auth.Method{
104+
auth.Shortcut{
105+
// auth.OAuth2 and auth.Basic both read "Authorization: Bearer <token>" header,
106+
// so we need have a shortcut for them to avoid the first one returning error to skip the second one.
107+
&auth.OAuth2{},
108+
&conan.Auth{},
109+
},
104110
&auth.OAuth2{},
105111
&auth.Basic{},
106112
&nuget.Auth{},

0 commit comments

Comments
 (0)