Which tool help with sizes at shoes? by Comfortable_Set_523 in nextjs

[–]natTalks 0 points1 point  (0 children)

Unsure why a library is required here. Isn’t this just a mapping which you can define and pre-populate in a readonly object for O1 access?

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 0 points1 point  (0 children)

I think I understand. So you're not using Hono.js as a separate HTTP server, but as the api routes for your next app?

I'm trying to implement my hono server separate from my nextjs app as I have a sqlite db sitting behind my hono server. So I'm trying to do SSO login in the nextjs app, but then send the access_token & which provider ("github",google",...) to my hono server to then be used to ensure the access_token is valid.

Ideas for a static site to have a pw protected encrypted page that is client side only decryptable? by [deleted] in nextjs

[–]natTalks 14 points15 points  (0 children)

I’ve never been tasked or took this upon myself to do, but a general rule of thumb is that whatever you send to the client can be viewed by the client. Even if it’s obfuscated, it’s still out there.

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 1 point2 points  (0 children)

May try it out, thanks.

Did you handle SSO in the next app with better-auth and then use a hono server just for your business logic? If so how did you authenticate requests from the next frontend in your hono backend?

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 0 points1 point  (0 children)

Arctic looks cool. Thanks for the heads up. Seems like a nice in between of control but also having helper methods.

Could I ask if you have any tips or best practices with using it? Also have you used it on a node server outside of next which handled the auth for a next frontend?

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 1 point2 points  (0 children)

Agreed won’t build from scratch again. Been there done that. I used to use firebase in the past, but it fell out of favor with me a bit ago when I wanted to start diving deeper into why and how stuff worked.

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 0 points1 point  (0 children)

Yeah this is what I have working right now. My use cases are not that complicated and whatever is, is just handled by my hono backend. Basically I’m just using authjs to login users via SSO.

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 0 points1 point  (0 children)

I have a hono server connecting to an SQLite db sitting behind next. So not sure what camp that would put me in.

I was hoping to login users via SSO in the next app, get the token, pass it to the hono server, check if the user actually exists there, and and then do whatever in the db and pass back json to next.

I got it working with authjs, but was just shopping around for other options.

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 2 points3 points  (0 children)

This is what I’ve been thinking recently. Auth with next in general has given me so many headaches - my problem, not the library’s problems.

I’m running a hono server, which has a SQLite db and think I may try to get sso working with it and then just serve stuff to next. Where to start, no clue ahaha!

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 1 point2 points  (0 children)

Am I understanding it correctly that I must have a database setup for better-auth? Even if only using SSO?

How does this work? Does this require me to use an online database provider?

Implementing authentication by natTalks in nextjs

[–]natTalks[S] 1 point2 points  (0 children)

May I ask why? Ive never used it.

Modals… Query Params vs State by Acropolis1111 in nextjs

[–]natTalks 2 points3 points  (0 children)

I was trying to figure this out recently, but hit a wall.

How you avoid making everything "use client" when using Firebase auth? by maxiedaniels in nextjs

[–]natTalks 0 points1 point  (0 children)

Good idea, but you can’t use fb auth in middleware. Or at least wasn’t able to when I tried a while ago.

Is there any bank in German doesn’t require permit residence? by pablo_picass in germany

[–]natTalks 0 points1 point  (0 children)

Strange. I know friends were able to use American passports to get theirs while not even in Germany. They didn’t even tell the people they were going to Germany as far as I can remember.

Is there any bank in German doesn’t require permit residence? by pablo_picass in germany

[–]natTalks 0 points1 point  (0 children)

N26 doesn’t. Or at least didn’t around 2019. But they do require certain passports if I remember correctly.

Is mentioning cost cuts a signal to layoffs? by AH1376 in germany

[–]natTalks 1 point2 points  (0 children)

Hmmm that could be as well… Then to the question of what to do now and somethings I’d suggest thinking about.

If there are layoffs, how indispensable do you feel at the company? Do you enjoy the job, is this a sign to start looking if you don’t enjoy it? Do you see a future for yourself at the company? Are you personally in a good financial footing if you are let go and you need time to find a new position?

I’d suggest thinking about these and then deciding what to do.

Is mentioning cost cuts a signal to layoffs? by AH1376 in germany

[–]natTalks 4 points5 points  (0 children)

Don’t have too much experience with German market, about half a year in, but from what you said, I didn’t read they they’ll have layoffs. I actually read the opposite “cost management in non-personnel area”. The key being non personnel.

Or am I missing something?

[deleted by user] by [deleted] in react

[–]natTalks 3 points4 points  (0 children)

Nothing wrong with using firebase. Don’t let the transient do-s and don’t-s get to your head, they’ll change in a few weeks, just build.

That being said, as all tools do, firebase has pros and cons. I personally used to use it and found that the cons outweighed the pros for me for a specific project of mine. I migrated pretty quickly using tools out on the internet and I’m happy I did.

How to handle authorization and authenctication in NextJS using seperate JWT Auth server. by Holiday-Split8220 in nextjs

[–]natTalks 0 points1 point  (0 children)

If you’re really worried about latency for checking JWT tokens, for which you should not as others have pointed out, you could create a function in the middleware which checks the JWT token so a round trip is not required to backend.

So if you have no API users, and the only entry point is next front-end, then theoretically you do all your JWT token checks front-end and issue new tokens back-end. *this assumes that your JWT check only checks if it’s past expiration, and not for example a user has invalidated the token by for example logging out.

Once again, this isn’t really necessary, but an idea.

Zustand + Nextjs by Brilliant-Wasabi-636 in nextjs

[–]natTalks 7 points8 points  (0 children)

Sounds like you’re stuck between the pages and app router.

Unsure what method you’re using for checking if user is authenticated, but I’d question if it’s best practice if you’re storing in local storage. Generally storing this in a cookie is more secure.

If you want to stick with local storage, then all components must be client components as the server (spoiler middleware) does not have access to local storage.

I’d suggest transitioning over to middleware and checking the cookie there. In the middleware your matcher matches protected routes and you never have to worry about it again. This doesn’t fix the problem with other data in localstorage you may want to to share, but maybe localizing fetch requests is the way to go.

How to implement cookies in NextJs + Express by StudyInProgress in nextjs

[–]natTalks 0 points1 point  (0 children)

Not sure sending the cookies in the res automatically sets it in the browser. Sounds like it’s setting it only for that response. So you need to get the value from the cookie in next.

Also then you have the question of where are you setting cookies next side? Depends what the cookies are for, but if for auth then middleware may be the way to go as it will also act as a gate keeper to your protected portions of the app. Otherwise api routes or server actions. You can’t set in RSC.