diff --git a/api/v1/jwt.go b/api/v1/jwt.go index eb11fac..3b22748 100644 --- a/api/v1/jwt.go +++ b/api/v1/jwt.go @@ -84,7 +84,7 @@ func JWTMiddleware(server *APIV1Service, next echo.HandlerFunc, secret string) e token := findAccessToken(c) if token == "" { // When the request is not authenticated, we allow the user to access the shortcut endpoints for those public shortcuts. - if util.HasPrefixes(path, "/api/v1/status", "/o/*") && method == http.MethodGet { + if util.HasPrefixes(path, "/api/v1/status", "/s/*") && method == http.MethodGet { return next(c) } return echo.NewHTTPError(http.StatusUnauthorized, "Missing access token") diff --git a/api/v1/v1.go b/api/v1/v1.go index b1f02fc..7f3f72d 100644 --- a/api/v1/v1.go +++ b/api/v1/v1.go @@ -30,7 +30,7 @@ func (s *APIV1Service) Start(apiGroup *echo.Group, secret string) { s.registerUserRoutes(apiV1Group) s.registerShortcutRoutes(apiV1Group) - redirectorGroup := apiGroup.Group("/o") + redirectorGroup := apiGroup.Group("/s") redirectorGroup.Use(func(next echo.HandlerFunc) echo.HandlerFunc { return JWTMiddleware(s, next, string(secret)) }) diff --git a/web/src/components/CreateShortcutDialog.tsx b/web/src/components/CreateShortcutDialog.tsx index 1bfee97..b7ecc12 100644 --- a/web/src/components/CreateShortcutDialog.tsx +++ b/web/src/components/CreateShortcutDialog.tsx @@ -128,7 +128,7 @@ const CreateShortcutDialog: React.FC = (props: Props) => { Name *
- o/ + s/ = (props: Props) => { }; const handleCopyButtonClick = (shortcut: Shortcut) => { - copy(absolutifyLink(`/o/${shortcut.name}`)); + copy(absolutifyLink(`/s/${shortcut.name}`)); toast.success("Shortcut link copied to clipboard."); }; diff --git a/web/vite.config.ts b/web/vite.config.ts index 1d9c119..28ddada 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -8,11 +8,11 @@ export default defineConfig({ host: "0.0.0.0", port: 3000, proxy: { - "/api": { + "/api/": { target: "http://localhost:8082/", changeOrigin: true, }, - "/o": { + "/s/": { target: "http://localhost:8082/", changeOrigin: true, },