BouncerU
TTCTheo's Typesafe Cult
•Created by flowmotion on 2/26/2025 in #questions
Create a TS function to deep call .toString() on all Date objects without type casting?
@flowmotion
You can do. You need to define a utility type that recursively replaces Date instances with string, and then create a function that applies this transformation.
3 replies
TTCTheo's Typesafe Cult
•Created by plyglt on 2/25/2025 in #questions
How do I prefetch trpc serverside and then hydrate the client?
@plyglt
you can take look at
https://trpc.io/docs/client/nextjs/server-side-helpers
4 replies
TTCTheo's Typesafe Cult
•Created by codelilac on 2/26/2025 in #questions
Better auth for a swift app with a hono backend - pain & suffering or a good idea?
You're making a solid choice by opting for Hono/TypeScript over a BaaS like Supabase, especially if you aim for cross-platform compatibility in the long run. However, your concerns about authentication complexity without a dedicated Swift SDK are valid.
In my experience, I'd recommend Supabase to you for easy setup and fully supported built-in manage flow.
But you're using Entra ID for login flow, and then Supabase doesn't support it natively, so Hono/TS would be good choice for you.
It will take more times like customize all thing such as OAuth, JWT, Swift integration
4 replies
TTCTheo's Typesafe Cult
•Created by msobkyy on 2/15/2025 in #questions
Trojan Virus in React Project!!
U must check package.json file carefully. There are operations. Each operation carefully and also check config, .env files something like. These files can contain malwarebytes commonly.It's so dangerous. Once you ran
npm run start
, you computer will be fully managed under hacker12 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
Only client side will be stuck when both token are expired or invalid
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
from middleway, you can check both tokens automatically. So even access token invalid, if refresh token is valid, new access token will be generated automatically and continue request.
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
if middleware return access token invalid 401 error, then client will request to obtain new access token using refresh token (new route)
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
But rather than reauth involvement of client side, it will be done smoothly with error response handling.
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
exactly
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
the same like 2nd
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
with combine both, you can archive using refresh token usage
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
But for the simple application and if prefer user experience on the application, first way is good. Without any client side refresh, reauthorization can be done.
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
For the large-scale and robust product, http cookie only is weak or need to combine both
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
Like middleware check token and if invalid send 401 error, and client side let user auto logout, re-login
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
So the best approach is to combine both ways
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
- For server-heavy applications with seamless UX, Option 1 (Middleware Handling Refresh) is preferable- For server-heavy applications with seamless UX, first prefered. Because middleware handle token verify
- For large-scale or stateless APIs where performance is critical, 2nd preferred. Because frontend side handle it. But in this case, client side may have some delay
28 replies
TTCTheo's Typesafe Cult
•Created by 泣いオオカミー ≛ 🏆 ≛ on 2/6/2025 in #questions
Question about refresh /access token
I often use 2nd approach
28 replies
TTCTheo's Typesafe Cult
•Created by greypixel on 2/4/2025 in #questions
Images w/ next & vercel
But I think the reason why we use next-image is just for optimize
11 replies
TTCTheo's Typesafe Cult
•Created by greypixel on 2/4/2025 in #questions
Images w/ next & vercel
If you're using using CDN image or svg image, you need to use basic
<img>
tag. Next-image won't optimize it. Also if your image size is small, you can use <img>
.
But in case of following, I recommend u to use next-image component.
- You want automatic optimization, lazy loading, and resizing.
- You’re serving static or dynamic images that should be optimized.
- Your images are large or need different sizes for different devices.
- You want SEO and performance benefits.
next-image
provide so awesome benefits like optimize side, caching, responsive support, auto resizing per devices, blur, LQIP.
So next-image
component preferred11 replies
TTCTheo's Typesafe Cult
•Created by greypixel on 2/4/2025 in #questions
Images w/ next & vercel
@greypixel
11 replies