PharmaLedger-IMI / ctr-workspace

UC8 Clinical Trials Recruitment
MIT License
2 stars 0 forks source link

POST /borest/auth/login with type parameter #10

Closed joaoluis-pdm closed 3 years ago

joaoluis-pdm commented 3 years ago
De: Jain, Prateek 
Enviado: 4 de junho de 2021 22:34
...
Assunto: Re: PharmaLedger-CTR Application Login form issue

Hi Joao,

Can we add UserType parameter in the Login API to restrict users with their login type?
joaoluis-pdm commented 3 years ago
De: João Paulo Luís 
Enviado: 7 de junho de 2021 11:24
Para: Jain, Prateek <
Assunto: RE: PharmaLedger-CTR Application Login form issue

Sure. If I understood correctly, the release notes in DEV already show:

v0.3.7 Release notes 2021-04-07
...
POST /borest/auth/login now accepts an optional type parameter.
                    If the type parameter its present, then its value must match the type parameter given in the POST /borest/auth/signup for that user.
                    Future releases may make this parameter mandatory.
                    No changes done to POST /borest/auth/get/current and neither to the JWT payload which contains only the id and username properties.</li>

PS: The parameter type is optional for now, so that the backoffice apps keep working for now. When you are ready, tell me, and I will make it mandatory.
The only addicitonal difference is that if the type value is distinct from the one gaven at signup, then an HTTP 401 Unauthorized will occur.

João Luís