Browse Source

refactor: revert auth apis path

pull/6644/head
Pranav C 1 year ago
parent
commit
6af30e6d67
  1. 22
      packages/nocodb/src/controllers/auth/auth.controller.ts
  2. 20
      packages/nocodb/src/schema/swagger.json

22
packages/nocodb/src/controllers/auth/auth.controller.ts

@ -37,7 +37,7 @@ export class AuthController {
@Post([ @Post([
'/auth/user/signup', '/auth/user/signup',
'/api/v1/db/auth/user/signup', '/api/v1/db/auth/user/signup',
'/api/v2/auth/user/signup', '/api/v1/auth/user/signup',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
@ -57,7 +57,7 @@ export class AuthController {
@Post([ @Post([
'/auth/token/refresh', '/auth/token/refresh',
'/api/v1/db/auth/token/refresh', '/api/v1/db/auth/token/refresh',
'/api/v2/auth/token/refresh', '/api/v1/auth/token/refresh',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
@ -74,7 +74,7 @@ export class AuthController {
@Post([ @Post([
'/auth/user/signin', '/auth/user/signin',
'/api/v1/db/auth/user/signin', '/api/v1/db/auth/user/signin',
'/api/v2/auth/user/signin', '/api/v1/auth/user/signin',
]) ])
@UseGuards(PublicApiLimiterGuard, AuthGuard('local')) @UseGuards(PublicApiLimiterGuard, AuthGuard('local'))
@HttpCode(200) @HttpCode(200)
@ -87,7 +87,7 @@ export class AuthController {
} }
@UseGuards(GlobalGuard) @UseGuards(GlobalGuard)
@Post('/api/v2/auth/user/signout') @Post('/api/v1/auth/user/signout')
@HttpCode(200) @HttpCode(200)
async signOut(@Request() req, @Response() res): Promise<any> { async signOut(@Request() req, @Response() res): Promise<any> {
if (!(req as any).isAuthenticated()) { if (!(req as any).isAuthenticated()) {
@ -115,8 +115,8 @@ export class AuthController {
// google strategy will take care the request // google strategy will take care the request
} }
@Get(['/auth/user/me', '/api/v1/db/auth/user/me', '/api/v2/auth/user/me']) @Get(['/auth/user/me', '/api/v1/db/auth/user/me', '/api/v1/auth/user/me'])
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(GlobalGuard)
async me(@Request() req) { async me(@Request() req) {
const user = { const user = {
...req.user, ...req.user,
@ -130,7 +130,7 @@ export class AuthController {
@Post([ @Post([
'/user/password/change', '/user/password/change',
'/api/v1/db/auth/password/change', '/api/v1/db/auth/password/change',
'/api/v2/auth/password/change', '/api/v1/auth/password/change',
]) ])
@UseGuards(MetaApiLimiterGuard, GlobalGuard) @UseGuards(MetaApiLimiterGuard, GlobalGuard)
@Acl('passwordChange', { @Acl('passwordChange', {
@ -154,7 +154,7 @@ export class AuthController {
@Post([ @Post([
'/auth/password/forgot', '/auth/password/forgot',
'/api/v1/db/auth/password/forgot', '/api/v1/db/auth/password/forgot',
'/api/v2/auth/password/forgot', '/api/v1/auth/password/forgot',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
@ -171,7 +171,7 @@ export class AuthController {
@Post([ @Post([
'/auth/token/validate/:tokenId', '/auth/token/validate/:tokenId',
'/api/v1/db/auth/token/validate/:tokenId', '/api/v1/db/auth/token/validate/:tokenId',
'/api/v2/auth/token/validate/:tokenId', '/api/v1/auth/token/validate/:tokenId',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
@ -185,7 +185,7 @@ export class AuthController {
@Post([ @Post([
'/auth/password/reset/:tokenId', '/auth/password/reset/:tokenId',
'/api/v1/db/auth/password/reset/:tokenId', '/api/v1/db/auth/password/reset/:tokenId',
'/api/v2/auth/password/reset/:tokenId', '/api/v1/auth/password/reset/:tokenId',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)
@ -205,7 +205,7 @@ export class AuthController {
@Post([ @Post([
'/api/v1/db/auth/email/validate/:tokenId', '/api/v1/db/auth/email/validate/:tokenId',
'/api/v2/auth/email/validate/:tokenId', '/api/v1/auth/email/validate/:tokenId',
]) ])
@UseGuards(PublicApiLimiterGuard) @UseGuards(PublicApiLimiterGuard)
@HttpCode(200) @HttpCode(200)

20
packages/nocodb/src/schema/swagger.json

@ -88,7 +88,7 @@
} }
} }
}, },
"/api/v1/db/auth/user/signup": { "/api/v1/auth/user/signup": {
"post": { "post": {
"summary": "Signup", "summary": "Signup",
"operationId": "auth-signup", "operationId": "auth-signup",
@ -187,7 +187,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/signout": { "/api/v1/auth/user/signout": {
"post": { "post": {
"summary": "Signout", "summary": "Signout",
"operationId": "auth-signout", "operationId": "auth-signout",
@ -231,7 +231,7 @@
} }
] ]
}, },
"/api/v1/db/auth/user/signin": { "/api/v1/auth/user/signin": {
"post": { "post": {
"summary": "Signin", "summary": "Signin",
"operationId": "auth-signin", "operationId": "auth-signin",
@ -292,7 +292,7 @@
} }
] ]
}, },
"/api/v1/db/auth/user/me": { "/api/v1/auth/user/me": {
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/xc-auth" "$ref": "#/components/parameters/xc-auth"
@ -344,7 +344,7 @@
] ]
} }
}, },
"/api/v1/db/auth/password/forgot": { "/api/v1/auth/password/forgot": {
"post": { "post": {
"summary": "Forget Password", "summary": "Forget Password",
"operationId": "auth-password-forgot", "operationId": "auth-password-forgot",
@ -408,7 +408,7 @@
} }
] ]
}, },
"/api/v1/db/auth/password/change": { "/api/v1/auth/password/change": {
"post": { "post": {
"summary": "Change Password", "summary": "Change Password",
"operationId": "auth-password-change", "operationId": "auth-password-change",
@ -469,7 +469,7 @@
} }
] ]
}, },
"/api/v1/db/auth/token/validate/{token}": { "/api/v1/auth/token/validate/{token}": {
"post": { "post": {
"summary": "Verify Reset Token", "summary": "Verify Reset Token",
"operationId": "auth-password-reset-token-validate", "operationId": "auth-password-reset-token-validate",
@ -529,7 +529,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",
@ -589,7 +589,7 @@
} }
] ]
}, },
"/api/v1/db/uth/password/reset/{token}": { "/api/v1/auth/password/reset/{token}": {
"post": { "post": {
"summary": "Reset Password", "summary": "Reset Password",
"operationId": "auth-password-reset", "operationId": "auth-password-reset",
@ -665,7 +665,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