Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peter/v2 hot fixes #84

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Peter/v2 hot fixes #84

merged 4 commits into from
Nov 6, 2023

Conversation

peterphanouvong
Copy link
Collaborator

Explain your changes

  • Auth provider types + don't error out on function calls when not authenticated
  • Auth middleware backwards compatibility (was checking against an old cookie name)
    Suppose there is a related issue with enough detail for a reviewer to understand your changes fully. In that case, you can omit an explanation and instead include either “Fixes #XX” or “Updates #XX” where “XX” is the issue number.

Checklist

🛟 If you need help, consider asking for advice over in the Kinde community.

@@ -1,6 +1,6 @@
{
"name": "@kinde-oss/kinde-auth-nextjs",
"version": "2.0.0-alpha.2",
"version": "2.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -10,11 +9,10 @@ export function authMiddleware(request) {
let isAuthenticated = false;
const nextUrl = trimTrailingSlash(request.nextUrl.href);
const logoutUrl = trimTrailingSlash(config.postLogoutRedirectURL);
const kinde_token = request.cookies.get('kinde_token');
const kinde_token = request.cookies.get('access_token');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterphanouvong is this right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaveOrDead yea, using TS SDK sets access_token in cookies instead of kinde_token

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I see. Seems this would create breaking changes for anyone accessing the cookie directly.

Could we instead update the TS SDK to allow a cookie name to be passed? That way we can pass kinde_token from the NextJS SDK which keeps it working as it was for existing users?

tsconfig.json Outdated
@@ -18,5 +18,8 @@
// "Go to Definition" in VSCode
"declarationMap": true,
"esModuleInterop": true
// "checkJs": true,
// "strict": true,
// "jsx": "react"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterphanouvong lets remove commented code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaveOrDead done!

@DaveOrDead DaveOrDead merged commit 82b6f54 into main Nov 6, 2023
@DaveOrDead DaveOrDead deleted the peter/v2-hot-fixes branch November 6, 2023 03:19
peterphanouvong pushed a commit that referenced this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants