mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
NET-811: block normal user login from accessing dashboard (#2724)
* block normal user login from accessing dashboard * header change * allow from ui header * allow from ui header * check for user role after decoding * block oauth login for normal user * handle other oauth provider callback funcs for user login
This commit is contained in:
@@ -41,7 +41,7 @@ func HandleRESTRequests(wg *sync.WaitGroup, ctx context.Context) {
|
||||
|
||||
// Currently allowed dev origin is all. Should change in prod
|
||||
// should consider analyzing the allowed methods further
|
||||
headersOk := handlers.AllowedHeaders([]string{"Access-Control-Allow-Origin", "X-Requested-With", "Content-Type", "authorization"})
|
||||
headersOk := handlers.AllowedHeaders([]string{"Access-Control-Allow-Origin", "X-Requested-With", "Content-Type", "authorization", "From-Ui"})
|
||||
originsOk := handlers.AllowedOrigins(strings.Split(servercfg.GetAllowedOrigin(), ","))
|
||||
methodsOk := handlers.AllowedMethods([]string{http.MethodGet, http.MethodPut, http.MethodPost, http.MethodDelete})
|
||||
|
||||
|
Reference in New Issue
Block a user