refactor(auth/sso): rename GetAuthorizationUrl for clarity (#10173)
- Rename `GetAuthorizationUrl` to `GetAuthorizationUrlForSSO` - Move `GetAuthorizationUrlForSSO` from `sso.resolver.ts` to `auth.resolver.ts` to avoid the permission guard and let users use an SSO provider. - Fix an issue in OIDC guard that breaks the connection if you have multiple SSO providers + add tests for OIDC guard.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/* @license Enterprise */
|
||||
|
||||
import { GET_AUTHORIZATION_URL } from '@/auth/graphql/mutations/getAuthorizationUrl';
|
||||
import { GET_AUTHORIZATION_URL_FOR_SSO } from '@/auth/graphql/mutations/getAuthorizationUrlForSSO';
|
||||
import { useRedirect } from '@/domain-manager/hooks/useRedirect';
|
||||
import { SnackBarVariant } from '@/ui/feedback/snack-bar-manager/components/SnackBar';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
@ -17,7 +17,7 @@ export const useSSO = () => {
|
||||
let authorizationUrlForSSOResult;
|
||||
try {
|
||||
authorizationUrlForSSOResult = await apolloClient.mutate({
|
||||
mutation: GET_AUTHORIZATION_URL,
|
||||
mutation: GET_AUTHORIZATION_URL_FOR_SSO,
|
||||
variables: {
|
||||
input: {
|
||||
identityProviderId,
|
||||
@ -32,7 +32,8 @@ export const useSSO = () => {
|
||||
}
|
||||
|
||||
redirect(
|
||||
authorizationUrlForSSOResult.data?.getAuthorizationUrl.authorizationURL,
|
||||
authorizationUrlForSSOResult.data?.getAuthorizationUrlForSSO
|
||||
.authorizationURL,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user