WOLG
WOLG
TTCTheo's Typesafe Cult
Created by WOLG on 7/6/2023 in #questions
Next-auth in a pure react app
As in the title, I've always owned my auth and made it using axios interceptors, I wanted to try next-auth in a pure vite react app. Is it possible to use it without api routes pure client side?
6 replies
TTCTheo's Typesafe Cult
Created by WOLG on 1/28/2023 in #questions
Dynamic page omit assertion of router.query
Hey , I am using an eslint rule that prevents me from invalid template literals. Is there anything I can do to omit pid as string ?
import { useRouter } from 'next/router'

const Post = () => {
const router = useRouter()
const { pid } = router.query

return <Link href={`/somepath/${pid}`}>Click</Link> // @typescript-eslint/restrict-template-expressions pid - string | string[] | undefined
}

export default Post
import { useRouter } from 'next/router'

const Post = () => {
const router = useRouter()
const { pid } = router.query

return <Link href={`/somepath/${pid}`}>Click</Link> // @typescript-eslint/restrict-template-expressions pid - string | string[] | undefined
}

export default Post
4 replies
TTCTheo's Typesafe Cult
Created by WOLG on 1/10/2023 in #questions
Benefits of NextPage type
As in the title. What are benefits of typing our next pages with NextPage type. (Next 13, pages dir) The only one I see is that I have to return JSX but since react 18 React.FC type does the same and not intentionaly types children why wouldn't I use it insead of NextPage?
2 replies
TTCTheo's Typesafe Cult
Created by WOLG on 12/29/2022 in #questions
Protecting static site data
Hey I was wondering if It's possible to protect a hard coded react / html site. If the site source code can be read / modified by users. What Is the purpose of making login forms with email / pass if it can be bypassed easily (by people that know smth about web)? Is there any way to not let users see a hard coded site?
48 replies