ResultadosDigitais / matrix

#matrix is the online open-source workplace inspired in sococo.com for distributed teams to have the experience of work together each day, side-by-side. No matter where team members might be. Working in an online workplace is even more productive when people are feeling in the same space.
MIT License
901 stars 238 forks source link

Add a user list method of authorization #320

Closed Jarzamendia closed 4 years ago

Jarzamendia commented 4 years ago

Description

Considering the use case where a deploy can only be accessed by members of a project, however the use of a secure domain is not possible. This PR adds an authorization method where only a list of users can login. Still maintaining authentication with Google Auth.

How to test?

Add the WHITELIST_USERS Env variable with an array of e-mails (WHITELIST_USERS=["teste@gmail.com", "teste2@gmail.com"]). Try to login with a google account.

Expected behavior

If the user have their email listed, login. If not, log that him is not authorized.

juliemar commented 4 years ago

@all-contributors please add @Jarzamendia for code

allcontributors[bot] commented 4 years ago

@juliemar

I've put up a pull request to add @Jarzamendia! :tada:

Jarzamendia commented 4 years ago

I tried to be as brief and direct as possible. If you find it necessary I can try to improve!