Skip to content

Commit

Permalink
changed method for social signin in widget
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushyadav1617 committed Nov 11, 2023
1 parent 1a6d18c commit 585743c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/widget/login/components/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,21 @@ export default function EmailComponent({
const storeOrgData = useOrgData(state => state.data);
const storeOrg_token = useOrgData(state => state.org_token);
const [showMore, setShowMore] = useState(false);
const socialLogin = (

const socialLogin = async (
social: string,
setLoading: (loading: boolean) => void
) => {
const url = `https://api.trustauthx.com/single/social/signup?provider=${social}&OrgToken=${storeOrg_token}`;
// reset();
const response = await fetch(
`https://api.trustauthx.com/single/social/signup?provider=${social}`,
{
method: 'POST',
body: JSON.stringify({
OrgToken: storeOrg_token
})
}
);
const { url } = (await response.json()) as { url: string };
window.location.href = url; //next router was creating a problem in routing back that's why window object is being used
};

Expand Down

0 comments on commit 585743c

Please sign in to comment.