fix: social auth authentication workflow (#1264)
* fix: github login mutation * dev: updated social auth workflow and handled multiple loads on user * dev: mutaing user and updated analytics logout issue resolved --------- Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
This commit is contained in:
parent
49f19c2c44
commit
66807bef0d
5 changed files with 28 additions and 41 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { useState } from "react";
|
||||
|
||||
import Image from "next/image";
|
||||
import Router, { useRouter } from "next/router";
|
||||
import Router from "next/router";
|
||||
|
||||
import { mutate } from "swr";
|
||||
|
||||
|
|
@ -38,8 +37,6 @@ const Onboarding: NextPage = () => {
|
|||
|
||||
const [workspace, setWorkspace] = useState();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { user, mutateUser } = useUserAuth("onboarding");
|
||||
|
||||
return (
|
||||
|
|
@ -89,21 +86,7 @@ const Onboarding: NextPage = () => {
|
|||
userService
|
||||
.updateUserOnBoard({ userRole }, user)
|
||||
.then(async () => {
|
||||
mutate<ICurrentUserResponse>(
|
||||
CURRENT_USER,
|
||||
(prevData) => {
|
||||
if (!prevData) return prevData;
|
||||
|
||||
return {
|
||||
...prevData,
|
||||
user: {
|
||||
...prevData.user,
|
||||
is_onboarded: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
false
|
||||
);
|
||||
mutateUser();
|
||||
const userWorkspaces = await workspaceService.userWorkspaces();
|
||||
|
||||
const lastActiveWorkspace =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue