Welcome to the Kinde community

z
zor
Offline, last seen 2 months ago
Joined September 23, 2024
CODE CAUSES ERROR:
Plain Text
import { LoginLink, RegisterLink } from "@kinde-oss/kinde-auth-nextjs";

// ...
        <div>
        <LoginLink>Sign in</LoginLink>
        <RegisterLink>Sign up-</RegisterLink>
        </div>


ERROR:
Plain Text
Server Error
Error: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
s
node_modules\@kinde-oss\kinde-auth-nextjs\dist\index.js (1:11579)
(rsc)/./node_modules/@kinde-oss/kinde-auth-nextjs/dist/index.js
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/.next/server/vendor-chunks/@kinde-oss.js (20:1)
__webpack_require__
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(rsc)/./src/app/page.tsx (8:86)
(rsc)/./src/app/page.tsx
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/.next/server/app/page.js (195:1)
Function.__webpack_require__
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/.next/server/webpack-runtime.js (33:42)
runNextTicks
node:internal/process/task_queues (60:5)
listOnTimeout
node:internal/timers (540:9)
process.processTimers
node:internal/timers (514:7)
async eq
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (35:402260)
async tr
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (35:405987)
async tn
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (35:406537)
async tn
file:///C:/Users/CASPER/Desktop/projeler/convexstack/convex-playground/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (35:406668)
async tu...
6 comments
J
D
z
Hi, how should I handle database schema while using Kinde? Should I try for creating user model in my database schema e.g. username email registryDate gotWarnings? If we answer this question and let's say I shouldn't create a user model since I use Kinde, how should I handle the situation users register their restaurants in my app? I'm not trying to ask something unrelated but how that relation works with the Kinde user and restaurant if I create the restaurant model. I use Convex as my Backend and very new to both Kinde and Convex.
12 comments
z
P
C
Anyone using Next.js and middleware.js to protect pages? Mine didn't work and docs says there is limitation due to Next.js caching, so I wonder if it works.
9 comments
A
z
Hi, I'm coming from a Kinde competitor, I love Kinde. It has many more advantage for me also how it already includes the 2FA.

I am using Next.js 14 I want to redirect user to login page directly. Docs says 💡 As of right now the middleware in the app router does not work when trying to redirect to api/auth/login. This is because of Next.js caching which causes issues during authentication.. So do I have to put
Plain Text
    const { isAuthenticated, isLoading } = useKindeBrowserClient();

    if (isLoading)
    return (
      <div>Loading...</div>
      )
    return isAuthenticated ? (
    <div>You can see this page.</div>
  ) : ( 
    <div>
        You have to <LoginLink>Login</LoginLink> to see this page.
    </div>
every page.tsx? Also redirect to sign in would be better UX for. So isn't that possible to use Middleware for my situation?
15 comments
O
z