Corrected auth documentation
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
{
"openapi": "3.0.3",
"servers": [
+ {
+ "description": "Localhost - Development",
+ "url": "http://localhost:8080/v1"
+ },
{
"description": "SCP - Production system",
"url": "https://sap-ev-rest-server-prod.cfapps.eu10.hana.ondemand.com/v1"
{
"description": "SCP - Quality system",
"url": "https://sap-ev-rest-server-qa.cfapps.eu10.hana.ondemand.com/v1"
- },
- {
- "description": "Localhost - Development",
- "url": "http://localhost:8080/v1"
}
],
"info": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
+ "required": [
+ "email", "password", "acceptEula", "tenant"
+ ],
"properties": {
"email": {
"type": "string",
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
+ "required": [
+ "email", "name", "firstName", "passwords", "acceptEula", "tenant", "captcha"
+ ],
"properties": {
"email": {
"type": "string",
},
"name": {
"type": "string",
- "example": "Alouache"
+ "example": "Demo"
},
"firstName": {
"type": "string",
- "example": "Loan"
+ "example": "User"
},
"passwords": {
"type": "object",
"captcha": {
"type": "string",
"example": "03AGdBq27rf-WyiNvo8yOO11OjDwgST4ZiQ-dtKxxDvVzxtU7XG6Oqff-M-KXe8RwCsHrlgU-4BCi_Y9CLLSC-DHMZkK-YS2fIJ4TpVxwn2mCQ7PwgIi8HUJHudaq5Jb7W88zebKr_xWBa9zyLp4k8exaWwQ9v2Pnj-FSKTHHDpT66PZiHOfRVjg9Za6eQIHhbXkNK5m6ZKWgT92XYigaJuTEPigGK7N5kbXHydXZFX6Ku5lntg9FRl7n737SRSAsO0joBb5XtgJV1vfZGyvnSjHECf3lmNdhZCQbdhGjEqn2vtHuodFk1i3kFzgEgMOS59A42m_zr4AME1Avd-hyAW80dybsbSKWbThyQx6iBRcOydgM9b10TI9kIpL8feLHBCvnmVutnhlp_Zz9MDTop5_Fdi3xvZHW-tLcLYHljECgnTHbApkcHfCSzgSJBlkB7_qifzRGitTfCUFGztgOCho6pKXeHAzc4XQ"
+ },
+ "locale": {
+ "type": "string",
+ "example": "en-US"
}
}
}
"description": "Tenant's subdomain",
"required": true,
"schema": {
- "type": "string"
+ "type": "string",
+ "example": "slf"
}
},
{
"in": "query",
"name": "language",
"description": "Browser language",
- "required": true,
"schema": {
- "type": "string"
+ "type": "string",
+ "example": "en"
}
}
],
},
"550": {
"description": "Unknown tenant"
- },
- "591": {
- "description": "Account already activated"
}
}
}
"500": {
"$ref": "#/components/responses/500BackendError"
},
+ "540": {
+ "description": "Invalid verification token"
+ },
"550": {
- "description": "Unknown tenant or logically deleted user"
+ "description": "Unknown tenant or user does not exist"
},
"591": {
"description": "Account already activated"
"$ref": "#/components/responses/500BackendError"
},
"550": {
- "description": "Unknown tenant"
+ "description": "Unknown tenant or user does not exist"
},
"591": {
"description": "Account already activated"

MODIFY
src/server/rest/v1/service/security/AuthSecurity.ts
src/server/rest/v1/service/security/AuthSecurity.ts
@@ -33,7 +33,9 @@ export default class AuthSecurity {
return {
name: sanitize(request.name),
firstName: sanitize(request.firstName),
- password: sanitize(request.passwords.password),
+ password: sanitize(
+ typeof request.passwords === 'string' ? JSON.parse(request.passwords).password : request.passwords.password
+ ),
acceptEula: sanitize(request.acceptEula),
captcha: sanitize(request.captcha),
status: UserStatus.PENDING,

Corrected auth documentation