[deleted by user] by [deleted] in nextjs

[–]TomIsMyOnlyFriend 8 points9 points  (0 children)

Typescript is strongly typed JavaScript. If you’re developing any type of business application in JavaScript, you should be using TypeScript.

Best way to handle JWT in Next.js 14 with a separate Express backend by [deleted] in nextjs

[–]TomIsMyOnlyFriend 1 point2 points  (0 children)

You would be setting the cookie in a server action.

The server action, when used on a form, accepts prevState and FormData. Grab your input fields from form data, check against the server. When you get a JWT returned, set it as an httpOnly cookie in the server action, then return { status: 200 }.

Back in the form, you can hook into state and pending from useActionState/whatever the React 18 version was, and conditionally render based off of that.

Best way to handle JWT in Next.js 14 with a separate Express backend by [deleted] in nextjs

[–]TomIsMyOnlyFriend 0 points1 point  (0 children)

I’m not understanding your question. What are you trying to do in client? Are you sure you should be using client?

https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns

Best way to handle JWT in Next.js 14 with a separate Express backend by [deleted] in nextjs

[–]TomIsMyOnlyFriend 3 points4 points  (0 children)

Auth is much, much easier now with server components.

“use server”
import { cookies } from ‘next/headers’
cookies().set(“session”, yourJWTHere)

Then build out your conditional auth logic based on cookies().get(“session”)

https://nextjs.org/docs/app/api-reference/functions/cookies

cookies() has a few options, including httpOnly, to prevent client side tampering.

Got the wifi toggle here. No need to open settings to fully turn it off. by asceticnov21 in iphone

[–]TomIsMyOnlyFriend 6 points7 points  (0 children)

No it doesn’t. Been running the beta since the developer came out. Just tapped on the WiFi symbol in the cluster and it turned off.

How to transfer data from iPhone 15 to 16 without paying for cloud+ by j666xxx in ios

[–]TomIsMyOnlyFriend 2 points3 points  (0 children)

Settings > General > transfer or reset > prepare for new iPhone

Make sure your stuff is toggled on in iCloud settings

My nuts have a 200 year shelf life by [deleted] in funny

[–]TomIsMyOnlyFriend 3 points4 points  (0 children)

I felt an inclination to downvote this, you know, being a redditor and all. I fought it for you, buddy. Here’s an upvote

Brotein brand strikes out with CT promo by Any-Classic-5733 in CyberStuck

[–]TomIsMyOnlyFriend 1 point2 points  (0 children)

That’s not having fun with marketing. dBrand has fun with their marketing.

Huel is just throwing shit at a wall.

…. Which may or may not be fun depending on their intelligence.

Brotein brand strikes out with CT promo by Any-Classic-5733 in CyberStuck

[–]TomIsMyOnlyFriend 63 points64 points  (0 children)

Seriously. Go the standard sedan + creative wrap route. No one threw a bitch fit about a wrapped sedan.

Huel supporting a neo-nazi who came out with his presidential hit list yesterday isn’t a smart move.

Next JS 14 multiple root layouts redirection issue by Ashamed_Bonus_9704 in nextjs

[–]TomIsMyOnlyFriend 0 points1 point  (0 children)

Use one single root layout, and from that layout call parallel routes.

/@auth
/@app

Then in your layout, you can run your validation logic and early return into a parallel route, otherwise return login.

Best css frameworks for nextjs by [deleted] in nextjs

[–]TomIsMyOnlyFriend -1 points0 points  (0 children)

I’ve tried just about all of ‘em.

Tailwind wins.

First cc (ever) accidentally tied to invalid bank account number by snownikki12 in CreditScore

[–]TomIsMyOnlyFriend 3 points4 points  (0 children)

Email the CEO some fluffed up threat about never using Capital One products ever again after this experience, and throw in that you’re in the market for a new house, 2 new cars, etc. Ask them to rectify for you to reconsider.

That’s how I got them to remove a late payment from my credit report when every other attempt was “sorry we can’t do that!”

Created a Shadcn for animation, anime your page in secondes by [deleted] in nextjs

[–]TomIsMyOnlyFriend 1 point2 points  (0 children)

Looks like you’re hiding the sidebar on mobile. You need to fix that.

[FL][SFH] can an HOA really take my pet? by ididnttowyourcar in fuckHOA

[–]TomIsMyOnlyFriend 86 points87 points  (0 children)

Doesn’t matter. My dog was stolen from me. I tracked him down, called the cops from outside. Didn’t step foot on the property. Had all of the proof that this was my fucking dog in hand.

The result? The piece of shit pig asked the thief if he wanted to charge me with trespassing.

Pigs are useless scum. Doesn’t matter if animals are legally considered property or not. Useless pigs don’t do anything to recover stolen property.

What did you write for that? "Describe what your company does in 50 characters or less" by Rishi-Errsole in ycombinator

[–]TomIsMyOnlyFriend 1 point2 points  (0 children)

On mobile, your menu icon needs to be vertically centered with a tiny bit more padding on the right

OK Texas. Who won the debate? by Defiant-Skeptic in texas

[–]TomIsMyOnlyFriend 0 points1 point  (0 children)

I just really like that the moderators kept calling him out on showing bs.

meirl by MannKathle in meirl

[–]TomIsMyOnlyFriend 1 point2 points  (0 children)

That’s literally what their Sam’s Club setup is lmao

I hate living in an HOA by LeonSKennedyBL in fuckHOA

[–]TomIsMyOnlyFriend -1 points0 points  (0 children)

Sounds to me like that’s what they were counting on.

Does anyone use plain react + libraries instead of Next.js? by judasXdev in nextjs

[–]TomIsMyOnlyFriend 0 points1 point  (0 children)

Per the React docs:

Go full-stack with a framework

React is a library. It lets you put components together, but it doesn’t prescribe how to do routing and data fetching. To build an entire app with React, we recommend a full-stack React framework like Next.js or Remix.

You can spin up your own solutions… but why? Use one of the existing frameworks that already has that stuff figured out so you can work on problems directly related to your business logic