diff --git a/routes/dashboard/dashboard_test.go b/routes/dashboard/dashboard_test.go index b844f59..db77bcf 100644 --- a/routes/dashboard/dashboard_test.go +++ b/routes/dashboard/dashboard_test.go @@ -29,7 +29,7 @@ func TestEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/file/file_test.go b/routes/file/file_test.go index f73d8d9..c48e386 100644 --- a/routes/file/file_test.go +++ b/routes/file/file_test.go @@ -50,7 +50,7 @@ func TestSignalEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/scenario/scenario_test.go b/routes/scenario/scenario_test.go index 8db44aa..3839138 100644 --- a/routes/scenario/scenario_test.go +++ b/routes/scenario/scenario_test.go @@ -30,7 +30,7 @@ func TestScenarioEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/signal/signal_test.go b/routes/signal/signal_test.go index 6ed0c7f..5c4654c 100644 --- a/routes/signal/signal_test.go +++ b/routes/signal/signal_test.go @@ -31,7 +31,7 @@ func TestSignalEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/simulationmodel/simulationmodel_test.go b/routes/simulationmodel/simulationmodel_test.go index 9ca0797..9dc8c11 100644 --- a/routes/simulationmodel/simulationmodel_test.go +++ b/routes/simulationmodel/simulationmodel_test.go @@ -29,7 +29,7 @@ func TestSimulationModelEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/simulator/simulator_test.go b/routes/simulator/simulator_test.go index b47e4a9..3ac13bc 100644 --- a/routes/simulator/simulator_test.go +++ b/routes/simulator/simulator_test.go @@ -31,7 +31,7 @@ func TestSimulatorEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/routes/user/user_endpoints.go b/routes/user/user_endpoints.go index 691d5fd..a1ace86 100644 --- a/routes/user/user_endpoints.go +++ b/routes/user/user_endpoints.go @@ -21,7 +21,7 @@ type tokenClaims struct { jwt.StandardClaims } -func VisitorAuthenticate(r *gin.RouterGroup) { +func RegisterAuthenticate(r *gin.RouterGroup) { r.POST("", authenticate) } diff --git a/routes/user/user_test.go b/routes/user/user_test.go index 00372b5..0734c6b 100644 --- a/routes/user/user_test.go +++ b/routes/user/user_test.go @@ -18,7 +18,7 @@ func TestUserEndpoints(t *testing.T) { router := gin.Default() api := router.Group("/api") - VisitorAuthenticate(api.Group("/authenticate")) + RegisterAuthenticate(api.Group("/authenticate")) api.Use(Authentication(true)) RegisterUserEndpoints(api.Group("/users")) diff --git a/routes/widget/widget_test.go b/routes/widget/widget_test.go index 1086da3..c88dd6b 100644 --- a/routes/widget/widget_test.go +++ b/routes/widget/widget_test.go @@ -29,7 +29,7 @@ func TestWidgetEndpoints(t *testing.T) { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true)) diff --git a/start.go b/start.go index 6d38eb2..792a85a 100644 --- a/start.go +++ b/start.go @@ -50,7 +50,7 @@ func main() { // All endpoints require authentication except when someone wants to // login (POST /authenticate) - user.VisitorAuthenticate(api.Group("/authenticate")) + user.RegisterAuthenticate(api.Group("/authenticate")) api.Use(user.Authentication(true))