Add toArray util

This commit is contained in:
rijkvanzanten
2020-10-15 18:00:27 -04:00
parent cac329c783
commit 592ab925db
13 changed files with 44 additions and 29 deletions

View File

@@ -12,6 +12,7 @@ import { UsersService, AuthenticationService } from '../services';
import grantConfig from '../grant';
import { RouteNotFoundException } from '../exceptions';
import { respond } from '../middleware/respond';
import { toArray } from '../utils/to-array';
const router = Router();
@@ -213,7 +214,7 @@ router.post(
router.get(
'/oauth',
asyncHandler(async (req, res, next) => {
const providers = env.OAUTH_PROVIDERS as string[];
const providers = toArray(env.OAUTH_PROVIDERS);
res.locals.payload = { data: providers.length > 0 ? providers : null };
return next();
}),