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

@ -23,7 +23,7 @@ import CommandMenu from "components/onboarding/command-menu";
// images
import Logo from "public/onboarding/logo.svg";
// types
import type { NextPage, NextPageContext } from "next";
import type { NextPage, GetServerSidePropsContext } from "next";
const Onboarding: NextPage = () => {
const [step, setStep] = useState(1);
@ -92,10 +92,10 @@ const Onboarding: 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 {