T
T
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Aless on 2/4/2024 in #questions
May I have accidentally downloaded a malicious npm package?
All that happened is you accidentally installed an npm package from 11 years ago. It looks safe to me. Just old and not particularly useful
17 replies
TTCTheo's Typesafe Cult
Created by Aless on 2/4/2024 in #questions
May I have accidentally downloaded a malicious npm package?
Do you have any legitimate reason to believe that this package is malicious? I think you may be overreacting in this particular scenario
17 replies
TTCTheo's Typesafe Cult
Created by T on 4/15/2023 in #questions
Uncaught TypeError: Om is not a function
Idk how I didn't figure it out sooner
3 replies
TTCTheo's Typesafe Cult
Created by T on 4/15/2023 in #questions
Uncaught TypeError: Om is not a function
I fixed it! I needed to change
import * as dayJs from "dayjs";
import * as dayJs from "dayjs";
to
import dayjs from "dayjs";
import dayjs from "dayjs";
3 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
Clearing cookies doesn't help
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
even if I already logged in
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
It routes to login every time I go to /product/whatever
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
Sorry for the delay. Here's my middleware code
import { withAuth } from "next-auth/middleware"

export default withAuth(
// `withAuth` augments your `Request` with the user's token.
function middleware(req) {
console.log("Auth", req.nextauth.token)
},
{
callbacks: {
authorized: ({ token }) => token !== null,
},
}
)

export const config = { matcher: ["/product/:path*"] }
import { withAuth } from "next-auth/middleware"

export default withAuth(
// `withAuth` augments your `Request` with the user's token.
function middleware(req) {
console.log("Auth", req.nextauth.token)
},
{
callbacks: {
authorized: ({ token }) => token !== null,
},
}
)

export const config = { matcher: ["/product/:path*"] }
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
I will share some code and try deleting cookies tomorrow
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
Even when I'm logged in
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
I'm still trying to get this to work, but my token is always coming back null in the callback
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
It always redirects to sign in
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
I'm still getting the infinite sign in loop :/
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
Oh wait theres another example further down
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
Since in the example they use await in the async function and pass a context
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
This example is using getServerSideProps inside of a page. How would I go about doing this in middleware?
55 replies
TTCTheo's Typesafe Cult
Created by T on 1/25/2023 in #questions
Protected routes in Nextjs?
In regards to the screenshot I posted, I tried using that method and still get redirected to login even if I'm logged in with Discord for some reason
55 replies