mirror of
https://github.com/directus/directus.git
synced 2026-01-30 08:47:57 -05:00
Add toArray util
This commit is contained in:
@@ -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();
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user