ToolJet/server/ee/controllers/oauth.controller.ts
Midhun G S 3297fdb68a
Instance level SSO for Multi-Workpsace (#3441)
* changes

* changes

* e2e testcases

* fixes

* fix

* changes

* e2e fixes

* test cases

* clean up

* redirection changes

* style changes

* test cases

* testcases fix

* added test cases

* doc changes

* doc changes

* invitation token fix

* SSO General settings page changes

* added sso button to signup pages

* added helper text

* fix

* test case fixes

* fix
2022-07-18 11:40:52 +05:30

21 lines
743 B
TypeScript

import { Body, Controller, Param, Post, UseGuards } from '@nestjs/common';
import { OauthService } from '../services/oauth/oauth.service';
import { MultiOrganizationGuard } from 'src/modules/auth/multi-organization.guard';
@Controller('oauth')
export class OauthController {
constructor(private oauthService: OauthService) {}
@Post('sign-in/:configId')
async signIn(@Param('configId') configId, @Body() body) {
const result = await this.oauthService.signIn(body, configId);
return result;
}
@UseGuards(MultiOrganizationGuard)
@Post('sign-in/common/:ssoType')
async commonSignIn(@Param('ssoType') ssoType, @Body() body) {
const result = await this.oauthService.signIn(body, null, ssoType);
return result;
}
}