Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing TS example of custom signin page #6549

Closed
peter-novak-m opened this issue Jan 29, 2023 · 8 comments
Closed

Missing TS example of custom signin page #6549

peter-novak-m opened this issue Jan 29, 2023 · 8 comments
Labels
documentation Relates to documentation good first issue Good issue to take for first time contributors TypeScript Issues relating to TypeScript

Comments

@peter-novak-m
Copy link

What is the improvement or update you wish to see?

Would it be possible to get the example of pages/auth/signin.js provided on this page:
https://next-auth.js.org/configuration/pages
in Typescript as well?

Is there any context that might help us understand?

I am working on my first full application using https://create.t3.gg/ and would like to create my own NextAuth signing page in a typesafe way, but found the documentation about this just to cover JS.

Does the docs page already exist? Please link to it.

No response

@peter-novak-m peter-novak-m added documentation Relates to documentation triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jan 29, 2023
@balazsorban44 balazsorban44 added TypeScript Issues relating to TypeScript good first issue Good issue to take for first time contributors and removed triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jan 29, 2023
@shubhamku044
Copy link

Hey, can I take this issue? I will write the example in typescript as well.

@balazsorban44
Copy link
Member

I would just prefer if we convert the code examples on https://next-auth.js.org/configuration/pages to TS

for simplicity, there's even an Edit this page button at the bottom.

@shubhamku044
Copy link

Hey @balazsorban44, I went through the next-auth/react folder. I found a few things
Screenshot 2023-01-30 at 9 38 03 PM

To convert, the code examples to TS we first have to create a proper type variable and then export the type variable. Please let me know if I am wrong.

@balazsorban44
Copy link
Member

This is the only file needing an edit: https://github.com/nextauthjs/next-auth/edit/v4/docs/docs/configuration/pages.md

To be honest, @f98pno could you clarify exactly which block on that page caused issues for you with TypeScript? Most are very straightforward snippets.

@rawbinary
Copy link
Contributor

isn't infering from getServerSideProps enough? the props we pass from there is already typed.

function SignIn({ providers }: InferGetServerSidePropsType<typeof getServerSideProps>)

Just adding the above shall be enough, I suppose and like @balazsorban44 said, everything else is pretty straightforward.

@balazsorban44
Copy link
Member

Yeah, let's do that then, if OP does not comment on anything else, I'm inclined to close this issue with the above suggestion merged.

@rawbinary
Copy link
Contributor

i guess, this issue is applicable for new docs as well (main branch) on https://authjs.dev/guides/basics/pages .
@balazsorban44 Should I create a PR for that as well, linking on this issue ?

@balazsorban44
Copy link
Member

balazsorban44 commented Feb 3, 2023

Not necessary, as the new docs are being rewritten from scratch. 👍 Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Relates to documentation good first issue Good issue to take for first time contributors TypeScript Issues relating to TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants