Browse Source

fix: api path correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2462/head
Pranav C 2 years ago
parent
commit
60d1bbec4e
  1. 36
      packages/nocodb/src/lib/meta/api/userApi/userApis.ts
  2. 18
      scripts/sdk/swagger.json

36
packages/nocodb/src/lib/meta/api/userApi/userApis.ts

@ -516,7 +516,7 @@ const mapRoutes = router => {
})(req, res, next) })(req, res, next)
); );
// new API // deprecated new API
router.post('/api/v1/db/auth/user/signup', catchError(signup)); router.post('/api/v1/db/auth/user/signup', catchError(signup));
router.post('/api/v1/db/auth/user/signin', catchError(signin)); router.post('/api/v1/db/auth/user/signin', catchError(signin));
router.get( router.get(
@ -549,5 +549,39 @@ const mapRoutes = router => {
'/api/v1/db/auth/password/reset/:tokenId', '/api/v1/db/auth/password/reset/:tokenId',
catchError(renderPasswordReset) catchError(renderPasswordReset)
); );
// new API
router.post('/api/v1/auth/user/signup', catchError(signup));
router.post('/api/v1/auth/user/signin', catchError(signin));
router.get(
'/api/v1/auth/user/me',
extractProjectIdAndAuthenticate,
catchError(me)
);
router.post('/api/v1/auth/password/forgot', catchError(passwordForgot));
router.post(
'/api/v1/auth/token/validate/:tokenId',
catchError(tokenValidate)
);
router.post(
'/api/v1/auth/password/reset/:tokenId',
catchError(passwordReset)
);
router.post(
'/api/v1/auth/email/validate/:tokenId',
catchError(emailVerification)
);
router.post(
'/api/v1/auth/password/change',
ncMetaAclMw(passwordChange, 'passwordChange')
);
router.post(
'/api/v1/auth/token/refresh',
ncMetaAclMw(refreshToken, 'refreshToken')
);
router.get(
'/api/v1/auth/password/reset/:tokenId',
catchError(renderPasswordReset)
);
}; };
export { mapRoutes as userApis }; export { mapRoutes as userApis };

18
scripts/sdk/swagger.json

@ -10,7 +10,7 @@
} }
], ],
"paths": { "paths": {
"/api/v1/db/auth/user/signup": { "/api/v1/auth/user/signup": {
"post": { "post": {
"summary": "Signup", "summary": "Signup",
"operationId": "auth-signup", "operationId": "auth-signup",
@ -95,7 +95,7 @@
"description": "Create a new user with provided email and password and first user is marked as super admin. " "description": "Create a new user with provided email and password and first user is marked as super admin. "
} }
}, },
"/api/v1/db/auth/user/signin": { "/api/v1/auth/user/signin": {
"post": { "post": {
"summary": "Signin", "summary": "Signin",
"operationId": "auth-signin", "operationId": "auth-signin",
@ -167,7 +167,7 @@
}, },
"parameters": [] "parameters": []
}, },
"/api/v1/db/auth/user/me": { "/api/v1/auth/user/me": {
"parameters": [], "parameters": [],
"get": { "get": {
"summary": "User info", "summary": "User info",
@ -214,7 +214,7 @@
] ]
} }
}, },
"/api/v1/db/auth/password/forgot": { "/api/v1/auth/password/forgot": {
"post": { "post": {
"summary": "Password forgot", "summary": "Password forgot",
"operationId": "auth-password-forgot", "operationId": "auth-password-forgot",
@ -248,7 +248,7 @@
}, },
"parameters": [] "parameters": []
}, },
"/api/v1/db/auth/password/change": { "/api/v1/auth/password/change": {
"post": { "post": {
"summary": "Password change", "summary": "Password change",
"operationId": "auth-password-change", "operationId": "auth-password-change",
@ -336,7 +336,7 @@
}, },
"parameters": [] "parameters": []
}, },
"/api/v1/db/auth/token/validate/{token}": { "/api/v1/auth/token/validate/{token}": {
"post": { "post": {
"summary": "Reset token verify", "summary": "Reset token verify",
"operationId": "auth-password-reset-token-validate", "operationId": "auth-password-reset-token-validate",
@ -361,7 +361,7 @@
} }
] ]
}, },
"/api/v1/db/auth/email/validate/{token}": { "/api/v1/auth/email/validate/{token}": {
"post": { "post": {
"summary": "Verify email", "summary": "Verify email",
"operationId": "auth-email-validate", "operationId": "auth-email-validate",
@ -386,7 +386,7 @@
} }
] ]
}, },
"/api/v1/db/auth/password/reset/{token}": { "/api/v1/auth/password/reset/{token}": {
"post": { "post": {
"summary": "Password reset", "summary": "Password reset",
"operationId": "auth-password-reset", "operationId": "auth-password-reset",
@ -425,7 +425,7 @@
} }
] ]
}, },
"/api/v1/db/auth/token/refresh": { "/api/v1/auth/token/refresh": {
"post": { "post": {
"summary": "Refresh token", "summary": "Refresh token",
"operationId": "auth-token-refresh", "operationId": "auth-token-refresh",

Loading…
Cancel
Save