From f245224aab9045ad858f7bd609f3b8988053e391 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Mon, 29 Jul 2024 17:59:21 +0530 Subject: [PATCH] fixes nextjs ssr docs --- .../nextjs/app-directory/protecting-route.mdx | 10 ++-------- .../app-directory/server-components-requests.mdx | 10 ++-------- .../nextjs/session-verification/in-ssr.mdx | 5 +---- .../nextjs/app-directory/protecting-route.mdx | 10 ++-------- .../app-directory/server-components-requests.mdx | 10 ++-------- v2/passwordless/nextjs/session-verification/in-ssr.mdx | 5 +---- .../nextjs/app-directory/protecting-route.mdx | 10 ++-------- .../app-directory/server-components-requests.mdx | 10 ++-------- v2/thirdparty/nextjs/session-verification/in-ssr.mdx | 5 +---- .../nextjs/app-directory/protecting-route.mdx | 10 ++-------- .../app-directory/server-components-requests.mdx | 10 ++-------- .../nextjs/session-verification/in-ssr.mdx | 5 +---- .../nextjs/app-directory/protecting-route.mdx | 10 ++-------- .../app-directory/server-components-requests.mdx | 10 ++-------- .../nextjs/session-verification/in-ssr.mdx | 5 +---- 15 files changed, 25 insertions(+), 100 deletions(-) diff --git a/v2/emailpassword/nextjs/app-directory/protecting-route.mdx b/v2/emailpassword/nextjs/app-directory/protecting-route.mdx index 4ceaefd7f..e636f81f0 100644 --- a/v2/emailpassword/nextjs/app-directory/protecting-route.mdx +++ b/v2/emailpassword/nextjs/app-directory/protecting-route.mdx @@ -239,10 +239,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -440,10 +437,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/emailpassword/nextjs/app-directory/server-components-requests.mdx b/v2/emailpassword/nextjs/app-directory/server-components-requests.mdx index 5021de0c4..a1cce731e 100644 --- a/v2/emailpassword/nextjs/app-directory/server-components-requests.mdx +++ b/v2/emailpassword/nextjs/app-directory/server-components-requests.mdx @@ -85,10 +85,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -225,10 +222,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/emailpassword/nextjs/session-verification/in-ssr.mdx b/v2/emailpassword/nextjs/session-verification/in-ssr.mdx index 903af905d..fcdfb1c8d 100644 --- a/v2/emailpassword/nextjs/session-verification/in-ssr.mdx +++ b/v2/emailpassword/nextjs/session-verification/in-ssr.mdx @@ -88,10 +88,7 @@ async function getSSRSessionHelper(context: GetServerSidePropsContext): Promise< } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/passwordless/nextjs/app-directory/protecting-route.mdx b/v2/passwordless/nextjs/app-directory/protecting-route.mdx index 4ceaefd7f..e636f81f0 100644 --- a/v2/passwordless/nextjs/app-directory/protecting-route.mdx +++ b/v2/passwordless/nextjs/app-directory/protecting-route.mdx @@ -239,10 +239,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -440,10 +437,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/passwordless/nextjs/app-directory/server-components-requests.mdx b/v2/passwordless/nextjs/app-directory/server-components-requests.mdx index 5021de0c4..a1cce731e 100644 --- a/v2/passwordless/nextjs/app-directory/server-components-requests.mdx +++ b/v2/passwordless/nextjs/app-directory/server-components-requests.mdx @@ -85,10 +85,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -225,10 +222,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/passwordless/nextjs/session-verification/in-ssr.mdx b/v2/passwordless/nextjs/session-verification/in-ssr.mdx index 903af905d..fcdfb1c8d 100644 --- a/v2/passwordless/nextjs/session-verification/in-ssr.mdx +++ b/v2/passwordless/nextjs/session-verification/in-ssr.mdx @@ -88,10 +88,7 @@ async function getSSRSessionHelper(context: GetServerSidePropsContext): Promise< } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdparty/nextjs/app-directory/protecting-route.mdx b/v2/thirdparty/nextjs/app-directory/protecting-route.mdx index 4ceaefd7f..e636f81f0 100644 --- a/v2/thirdparty/nextjs/app-directory/protecting-route.mdx +++ b/v2/thirdparty/nextjs/app-directory/protecting-route.mdx @@ -239,10 +239,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -440,10 +437,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdparty/nextjs/app-directory/server-components-requests.mdx b/v2/thirdparty/nextjs/app-directory/server-components-requests.mdx index 5021de0c4..a1cce731e 100644 --- a/v2/thirdparty/nextjs/app-directory/server-components-requests.mdx +++ b/v2/thirdparty/nextjs/app-directory/server-components-requests.mdx @@ -85,10 +85,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -225,10 +222,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdparty/nextjs/session-verification/in-ssr.mdx b/v2/thirdparty/nextjs/session-verification/in-ssr.mdx index 903af905d..fcdfb1c8d 100644 --- a/v2/thirdparty/nextjs/session-verification/in-ssr.mdx +++ b/v2/thirdparty/nextjs/session-verification/in-ssr.mdx @@ -88,10 +88,7 @@ async function getSSRSessionHelper(context: GetServerSidePropsContext): Promise< } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartyemailpassword/nextjs/app-directory/protecting-route.mdx b/v2/thirdpartyemailpassword/nextjs/app-directory/protecting-route.mdx index 9ed3ebb3b..062a948d2 100644 --- a/v2/thirdpartyemailpassword/nextjs/app-directory/protecting-route.mdx +++ b/v2/thirdpartyemailpassword/nextjs/app-directory/protecting-route.mdx @@ -240,10 +240,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -441,10 +438,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartyemailpassword/nextjs/app-directory/server-components-requests.mdx b/v2/thirdpartyemailpassword/nextjs/app-directory/server-components-requests.mdx index 47297fe52..8b6a4eb77 100644 --- a/v2/thirdpartyemailpassword/nextjs/app-directory/server-components-requests.mdx +++ b/v2/thirdpartyemailpassword/nextjs/app-directory/server-components-requests.mdx @@ -86,10 +86,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -226,10 +223,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartyemailpassword/nextjs/session-verification/in-ssr.mdx b/v2/thirdpartyemailpassword/nextjs/session-verification/in-ssr.mdx index 903af905d..fcdfb1c8d 100644 --- a/v2/thirdpartyemailpassword/nextjs/session-verification/in-ssr.mdx +++ b/v2/thirdpartyemailpassword/nextjs/session-verification/in-ssr.mdx @@ -88,10 +88,7 @@ async function getSSRSessionHelper(context: GetServerSidePropsContext): Promise< } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartypasswordless/nextjs/app-directory/protecting-route.mdx b/v2/thirdpartypasswordless/nextjs/app-directory/protecting-route.mdx index 4ceaefd7f..e636f81f0 100644 --- a/v2/thirdpartypasswordless/nextjs/app-directory/protecting-route.mdx +++ b/v2/thirdpartypasswordless/nextjs/app-directory/protecting-route.mdx @@ -239,10 +239,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -440,10 +437,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartypasswordless/nextjs/app-directory/server-components-requests.mdx b/v2/thirdpartypasswordless/nextjs/app-directory/server-components-requests.mdx index 5021de0c4..a1cce731e 100644 --- a/v2/thirdpartypasswordless/nextjs/app-directory/server-components-requests.mdx +++ b/v2/thirdpartypasswordless/nextjs/app-directory/server-components-requests.mdx @@ -85,10 +85,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } @@ -225,10 +222,7 @@ async function getSSRSessionHelper(): Promise<{ } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } } diff --git a/v2/thirdpartypasswordless/nextjs/session-verification/in-ssr.mdx b/v2/thirdpartypasswordless/nextjs/session-verification/in-ssr.mdx index 903af905d..fcdfb1c8d 100644 --- a/v2/thirdpartypasswordless/nextjs/session-verification/in-ssr.mdx +++ b/v2/thirdpartypasswordless/nextjs/session-verification/in-ssr.mdx @@ -88,10 +88,7 @@ async function getSSRSessionHelper(context: GetServerSidePropsContext): Promise< } return { accessTokenPayload: undefined, hasToken, error: undefined }; } catch (error) { - if (error instanceof JsonWebToken.TokenExpiredError) { - return { accessTokenPayload: undefined, hasToken, error: undefined }; - } - return { accessTokenPayload: undefined, hasToken, error: error as Error }; + return { accessTokenPayload: undefined, hasToken, error: undefined }; } }