Updated rest format
MODIFY
src/assets/server/rest/v1/docs/open-api-standard.json
src/assets/server/rest/v1/docs/open-api-standard.json
}
}
},
- "/passwordreset": {
+ "/password/reset": {
"post": {
"description": "Reset password",
"requestBody": {
}
}
},
- "/eula/{language}": {
+ "/eula": {
"get": {
"description": "Get tenant EULA",
"parameters": [
}
},
{
- "in": "path",
+ "in": "query",
"name": "language",
"description": "Browser language",
"required": true,
}
}
},
- "/checkEula": {
+ "/eula/check": {
"get": {
"description": "Check if a user accepted latest EULA",
"parameters": [
}
}
},
- "/verifyEmail": {
+ "/mail/check": {
"get": {
"description": "Verify email",
"parameters": [
}
}
},
- "/resendVerficationEmail": {
+ "/mail/resend": {
"post": {
"description": "Resend a verification email",
"requestBody": {

MODIFY
src/server/rest/v1/router/auth/AuthRouter.ts
src/server/rest/v1/router/auth/AuthRouter.ts
@@ -43,33 +43,32 @@ export default class AuthRouter {
}
protected buildRoutePasswordReset(): void {
- this.router.post(`/${ServerAction.REST_PASSWORD_RESET}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(AuthService.handleUserPasswordReset.bind(this), ServerAction.REST_PASSWORD_RESET, req, res, next);
+ this.router.post(`/${ServerAction.REST_PASSWORD}/reset`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(AuthService.handleUserPasswordReset.bind(this), ServerAction.REST_PASSWORD, req, res, next);
});
}
protected buildRouteResendVerificationMail(): void {
- this.router.post(`/${ServerAction.REST_RESEND_VERIFICATION_EMAIL}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(AuthService.handleResendVerificationEmail.bind(this), ServerAction.REST_RESEND_VERIFICATION_EMAIL, req, res, next);
+ this.router.post(`/${ServerAction.REST_MAIL}/resend`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(AuthService.handleResendVerificationEmail.bind(this), ServerAction.REST_MAIL, req, res, next);
});
}
protected buildRouteVerifyMail(): void {
- this.router.get(`/${ServerAction.REST_VERIFY_EMAIL}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(AuthService.handleVerifyEmail.bind(this), ServerAction.REST_VERIFY_EMAIL, req, res, next);
+ this.router.get(`/${ServerAction.REST_MAIL}/check`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(AuthService.handleVerifyEmail.bind(this), ServerAction.REST_MAIL, req, res, next);
});
}
protected buildRouteEndUserLicenseAgreement(): void {
- this.router.get(`/${ServerAction.REST_END_USER_LICENSE_AGREEMENT}/:language`, async (req: Request, res: Response, next: NextFunction) => {
- req.query.Language = sanitize(req.params.Language);
- await RouterUtils.handleServerAction(AuthService.handleGetEndUserLicenseAgreement.bind(this), ServerAction.REST_END_USER_LICENSE_AGREEMENT, req, res, next);
+ this.router.get(`/${ServerAction.REST_EULA}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(AuthService.handleGetEndUserLicenseAgreement.bind(this), ServerAction.REST_EULA, req, res, next);
});
}
protected buildRouteCheckEndUserLicenseAgreement(): void {
- this.router.get(`/${ServerAction.REST_CHECK_END_USER_LICENSE_AGREEMENT}`, async (req: Request, res: Response, next: NextFunction) => {
- await RouterUtils.handleServerAction(AuthService.handleCheckEndUserLicenseAgreement.bind(this), ServerAction.REST_CHECK_END_USER_LICENSE_AGREEMENT, req, res, next);
+ this.router.get(`/${ServerAction.REST_EULA}/check`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(AuthService.handleCheckEndUserLicenseAgreement.bind(this), ServerAction.REST_EULA, req, res, next);
});
}
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -374,11 +374,9 @@ export enum ServerAction {
REST_SIGNIN = 'signin',
REST_SIGNON = 'signon',
REST_SIGNOUT = 'signout',
- REST_PASSWORD_RESET = 'passwordReset',
- REST_VERIFY_EMAIL = 'verifyEmail',
- REST_RESEND_VERIFICATION_EMAIL = 'resendVerficationEmail',
- REST_END_USER_LICENSE_AGREEMENT = 'eula',
- REST_CHECK_END_USER_LICENSE_AGREEMENT = 'checkEula',
+ REST_PASSWORD = 'password',
+ REST_MAIL = 'mail',
+ REST_EULA = 'eula',
REST_PING = 'ping',
REST_TENANTS = 'tenants'
}

MODIFY
test/api/client/AuthenticationApi.ts
test/api/client/AuthenticationApi.ts
@@ -61,7 +61,7 @@ export default class AuthenticationApi {
// Send
const response = await this._baseApi.send({
method: 'POST',
- url: '/v1/auth/' + ServerAction.REST_PASSWORD_RESET,
+ url: '/v1/auth/' + ServerAction.REST_PASSWORD + '/reset',
headers: {
'Content-Type': 'application/json'
},
@@ -79,7 +79,7 @@ export default class AuthenticationApi {
// Send
const response = await this._baseApi.send({
method: 'POST',
- url: '/v1/auth/' + ServerAction.REST_RESEND_VERIFICATION_EMAIL,
+ url: '/v1/auth/' + ServerAction.REST_MAIL + '/resend',
headers: {
'Content-Type': 'application/json'
},
@@ -97,7 +97,7 @@ export default class AuthenticationApi {
// Send
const response = await this._baseApi.send({
method: 'GET',
- url: '/v1/auth/' + ServerAction.REST_VERIFY_EMAIL,
+ url: '/v1/auth/' + ServerAction.REST_MAIL + '/check',
headers: {
'Content-Type': 'application/json'
},

Updated rest format