Next.js Sub-Pages for parameterized routes

Issue Right now, my routing looks like this: https://app.com/users opens pages/users/index.js https://app.com/users/:userid opens pages/users/[id].js I want to create route, for example: https://app.com/users/:id/friends -> show all friends for the user or even https://app.com/users/:id/friends/:friendId -> show a specific friend I have tried

Continue reading

Logout from next-auth with keycloak provider not works

Issue I have a nextjs application with next-auth to manage the authentication. Here my configuration …. export default NextAuth({ // Configure one or more authentication providers providers: [ KeycloakProvider({ id: ‘my-keycloack-2’, name: ‘my-keycloack-2’, clientId: process.env.NEXTAUTH_CLIENT_ID, clientSecret: process.env.NEXTAUTH_CLIENT_SECRET, issuer: process.env.NEXTAUTH_CLIENT_ISSUER, profile:

Continue reading

NextJS SSR and Client side state

Issue I have the following nextJS app: export default function Home({ productsData }) { const [user, setUser] = useState(null); const [products, setProducts] = useState([]); useEffect(() => { if (productsData) setProducts(productsData); }, [productsData]); useEffect(() => { const userLocal = window.localStorage.getItem("user"); if

Continue reading

my app routs me to a page, but i cant access it directly

Issue i have setup a link that routes me to an about page (about.js): import React,{useState,useEffect} from ‘react’; import Link from ‘next/link’ ///————————PAGES——————————-/// import {default as Main} from ‘../app/sections/Main.js’ export default function Home() { const [site, setSite] = useState(‘down’); const

Continue reading

How can I specify child styles with next.js?

Issue I have: import styles from ‘./Editor.module.css’ … <ReactQuill theme="bubble" value={documentState.content} onChange={handleChange} modules={modules} formats={formats} onKeyDown={handleKeyDown} className={styles.quill} /> Where Editor.module.css is: .quill { height: 100%; flex-grow: 1; padding: 0; position: relative; } .quill .ql-container { position: absolute !important; } So the

Continue reading

NextJS next-auth get session always null

Issue Can’t get the session data using getSession({req}) on a api call? useSession() on a component is working fine. package versions: nextjs@12.01, next-auth@4.3.1 issue: api/lists.ts: import prisma from "../../../lib/prisma"; import { getSession } from "next-auth/react" export default async (req: NextApiRequest,

Continue reading

Next.js adding a css class to Link

Issue How does one add a css class to a Link component in Next.js? <Link className="app-subnav__link" href="/globalSettings" > Settings overview </Link> It doesn’t like the above! ES Link is throwing an error: Solution Try this: <Link href="/globalSettings"> <a className="app-subnav__link">Settings Overview</a>

Continue reading