Browse Source

fix: api path correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2462/head
Pranav C 3 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)
);
// new API
// deprecated new API
router.post('/api/v1/db/auth/user/signup', catchError(signup));
router.post('/api/v1/db/auth/user/signin', catchError(signin));
router.get(
@ -549,5 +549,39 @@ const mapRoutes = router => {
'/api/v1/db/auth/password/reset/:tokenId',
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 };

18
scripts/sdk/swagger.json

@ -10,7 +10,7 @@
}
],
"paths": {
"/api/v1/db/auth/user/signup": {
"/api/v1/auth/user/signup": {
"post": {
"summary": "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. "
}
},
"/api/v1/db/auth/user/signin": {
"/api/v1/auth/user/signin": {
"post": {
"summary": "Signin",
"operationId": "auth-signin",
@ -167,7 +167,7 @@
},
"parameters": []
},
"/api/v1/db/auth/user/me": {
"/api/v1/auth/user/me": {
"parameters": [],
"get": {
"summary": "User info",
@ -214,7 +214,7 @@
]
}
},
"/api/v1/db/auth/password/forgot": {
"/api/v1/auth/password/forgot": {
"post": {
"summary": "Password forgot",
"operationId": "auth-password-forgot",
@ -248,7 +248,7 @@
},
"parameters": []
},
"/api/v1/db/auth/password/change": {
"/api/v1/auth/password/change": {
"post": {
"summary": "Password change",
"operationId": "auth-password-change",
@ -336,7 +336,7 @@
},
"parameters": []
},
"/api/v1/db/auth/token/validate/{token}": {
"/api/v1/auth/token/validate/{token}": {
"post": {
"summary": "Reset token verify",
"operationId": "auth-password-reset-token-validate",
@ -361,7 +361,7 @@
}
]
},
"/api/v1/db/auth/email/validate/{token}": {
"/api/v1/auth/email/validate/{token}": {
"post": {
"summary": "Verify email",
"operationId": "auth-email-validate",
@ -386,7 +386,7 @@
}
]
},
"/api/v1/db/auth/password/reset/{token}": {
"/api/v1/auth/password/reset/{token}": {
"post": {
"summary": "Password reset",
"operationId": "auth-password-reset",
@ -425,7 +425,7 @@
}
]
},
"/api/v1/db/auth/token/refresh": {
"/api/v1/auth/token/refresh": {
"post": {
"summary": "Refresh token",
"operationId": "auth-token-refresh",

Loading…
Cancel
Save