fix: redirection after login (#320)

This commit is contained in:
Dakshesh Jain 2023-02-22 17:54:27 +05:30 committed by GitHub
parent d29f34566c
commit c1a78cc230
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 27 deletions

View file

@ -36,7 +36,7 @@ import {
XMarkIcon,
} from "@heroicons/react/24/outline";
// types
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
import type { IIssue, IUser } from "types";
// fetch-keys
import { USER_ISSUE, USER_WORKSPACE_INVITATIONS, PROJECTS_LIST } from "constants/fetch-keys";
@ -297,10 +297,10 @@ const Profile: NextPage = () => {
);
};
export const getServerSideProps = async (ctx: NextPageContext) => {
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const user = await requiredAuth(ctx.req?.headers.cookie);
const redirectAfterSignIn = ctx.req?.url;
const redirectAfterSignIn = ctx.resolvedUrl;
if (!user) {
return {