Lint and move redirectSSO into controller

This commit is contained in:
Tuan Dang
2023-07-21 17:54:09 +07:00
parent fd3cf70e13
commit 75e90201c0
6 changed files with 26 additions and 27 deletions
@@ -9,6 +9,15 @@ import {
import { getSSOConfigHelper } from "../../helpers/organizations";
import { client } from "../../../config";
import { ResourceNotFoundError } from "../../../utils/errors";
import { getSiteURL } from "../../../config";
export const redirectSSO = async (req: Request, res: Response) => {
if (req.isUserCompleted) {
return res.redirect(`${await getSiteURL()}/login/sso?token=${encodeURIComponent(req.providerAuthToken)}`);
}
return res.redirect(`${await getSiteURL()}/signup/sso?token=${encodeURIComponent(req.providerAuthToken)}`);
}
export const getSSOConfig = async (req: Request, res: Response) => {
const organizationId = req.query.organizationId as string;