-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(invitation): allow usage of personal invitation
- Loading branch information
Showing
20 changed files
with
403 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInWithGoogle.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import { useParams } from 'react-router-dom'; | ||
import { useParams, useSearchParams } from 'react-router-dom'; | ||
|
||
import { useAuth } from '@/auth/hooks/useAuth'; | ||
|
||
export const useSignInWithGoogle = () => { | ||
const workspaceInviteHash = useParams().workspaceInviteHash; | ||
const [searchParams] = useSearchParams(); | ||
const workspacePersonalInviteToken = | ||
searchParams.get('inviteToken') ?? undefined; | ||
const { signInWithGoogle } = useAuth(); | ||
return { signInWithGoogle: () => signInWithGoogle(workspaceInviteHash) }; | ||
return { | ||
signInWithGoogle: () => | ||
signInWithGoogle({ workspaceInviteHash, workspacePersonalInviteToken }), | ||
}; | ||
}; |
11 changes: 9 additions & 2 deletions
11
packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInWithMicrosoft.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import { useParams } from 'react-router-dom'; | ||
import { useParams, useSearchParams } from 'react-router-dom'; | ||
|
||
import { useAuth } from '@/auth/hooks/useAuth'; | ||
|
||
export const useSignInWithMicrosoft = () => { | ||
const workspaceInviteHash = useParams().workspaceInviteHash; | ||
const [searchParams] = useSearchParams(); | ||
const workspacePersonalInviteToken = | ||
searchParams.get('inviteToken') ?? undefined; | ||
const { signInWithMicrosoft } = useAuth(); | ||
return { | ||
signInWithMicrosoft: () => signInWithMicrosoft(workspaceInviteHash), | ||
signInWithMicrosoft: () => | ||
signInWithMicrosoft({ | ||
workspaceInviteHash, | ||
workspacePersonalInviteToken, | ||
}), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...-front/src/modules/workspace-member/grapqhql/mutations/addUserToWorkspaceByInviteToken.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { gql } from '@apollo/client'; | ||
|
||
export const ADD_USER_TO_WORKSPACE_BY_INVITE_TOKEN = gql` | ||
mutation AddUserToWorkspaceByInviteToken($inviteToken: String!) { | ||
addUserToWorkspaceByInviteToken(inviteToken: $inviteToken) { | ||
id | ||
} | ||
} | ||
`; |
Oops, something went wrong.