Adding pre-shared key authorization

This commit is contained in:
mati108@gmail.com committed 2019-02-02 11:53:35 -03:00
1 parent 41d68bcf01
commit fe9ab91b32
1 file changed
+2 -1
+2 -1
View File
@@ -5,7 +5,8 @@ import { AutorizationError } from '../errors'
const cloneDetails = async(authId, team, clone) => {
logger.debug('Retrieving clone details.')
if(!isAuthorized(team, authId)){
// TODO Pending improvement by authorization module
if(!(authId === process.env.AACLOUD_ID || isAuthorized(team, authId))){
logger.debug('User %s is not authorized to manage team %s.', authId, team.slug )
throw new AutorizationError()
}