You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let web and API routes have different auth methods group (#19168)
* remove the global methods but create dynamiclly
* Fix lint
* Fix windows lint
* Fix windows lint
* some improvements
Co-authored-by: wxiaoguang <[email protected]>
// The OAuth2 plugin is expected to be executed first, as it must ignore the user id stored
567
+
// in the session (if there is a user id stored in session other plugins might return the user
568
+
// object for that id).
569
+
//
570
+
// The Session plugin is expected to be executed second, in order to skip authentication
571
+
// for users that have already signed in.
572
+
funcbuildAuthGroup() *auth.Group {
573
+
group:=auth.NewGroup(
574
+
&auth.OAuth2{},
575
+
&auth.Basic{}, // FIXME: this should be removed once we don't allow basic auth in API
576
+
auth.SharedSession, // FIXME: this should be removed once all UI don't reference API/v1, see https://github.com/go-gitea/gitea/pull/16052
577
+
)
578
+
ifsetting.Service.EnableReverseProxyAuth {
579
+
group.Add(&auth.ReverseProxy{})
580
+
}
581
+
specialAdd(group)
582
+
583
+
returngroup
584
+
}
585
+
566
586
// Routes registers all v1 APIs routes to web application.
0 commit comments