Authentication Workflow fixes. Redirection fixes (#832)

* auth integration fixes

* auth integration fixes

* auth integration fixes

* auth integration fixes

* dev: update user api to return fallback workspace and improve the structure of the response

* dev: fix the issue keyerror and move onboarding logic to serializer method field

* dev: use-user-auth hook imlemented for route access validation and build issues resolved effected by user payload

* fix: global theme color fix

* style: new onboarding ui , fix: use-user-auth hook implemented

* fix: command palette, project invite modal and issue detail page mutation type fix

* fix: onboarding redirection fix

* dev: build isuue resolved

* fix: use user auth hook fix

* fix: sign in toast alert fix, sign out redirection fix and user theme error fix

* fix: user response fix

* fix: unAuthorizedStatus logic updated

---------

Co-authored-by: pablohashescobar <nikhilschacko@gmail.com>
Co-authored-by: gurusainath <gurusainath007@gmail.com>
Co-authored-by: anmolsinghbhatia <anmolsinghbhatia@caravel.tech>
This commit is contained in:
sriram veeraghanta 2023-05-30 09:44:35 -04:00 committed by GitHub
parent 33db616767
commit 44f8ba407d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 821 additions and 593 deletions

View file

@ -67,17 +67,19 @@ export const WorkspaceSidebarDropdown = () => {
};
const handleSignOut = async () => {
router.push("/signin").then(() => {
mutateUser();
});
await authenticationService.signOut().catch(() =>
setToastAlert({
type: "error",
title: "Error!",
message: "Failed to sign out. Please try again.",
await authenticationService
.signOut()
.then(() => {
mutateUser(undefined);
router.push("/");
})
);
.catch(() =>
setToastAlert({
type: "error",
title: "Error!",
message: "Failed to sign out. Please try again.",
})
);
};
return (
@ -137,8 +139,8 @@ export const WorkspaceSidebarDropdown = () => {
border border-brand-base bg-brand-surface-2 shadow-lg focus:outline-none"
>
<div className="flex flex-col items-start justify-start gap-3 p-3">
<div className="text-sm text-brand-secondary">{user?.email}</div>
<span className="text-sm font-semibold text-brand-secondary">Workspace</span>
<div className="text-sm text-gray-500">{user?.email}</div>
<span className="text-sm font-semibold text-gray-500">Workspace</span>
{workspaces ? (
<div className="flex h-full w-full flex-col items-start justify-start gap-3.5">
{workspaces.length > 0 ? (