The Wayback Machine - https://web.archive.org/web/20210301083637/https://github.com/nextauthjs/next-auth/issues/1284
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

Add the character encoding of the signin page #1284

Open
ExpressGradient opened this issue Feb 9, 2021 · 5 comments
Open

Add the character encoding of the signin page #1284

ExpressGradient opened this issue Feb 9, 2021 · 5 comments

Comments

@ExpressGradient
Copy link

@ExpressGradient ExpressGradient commented Feb 9, 2021

Describe the bug
The sign in page did not have a character encoding.

Steps to reproduce
Just click a button with signIn() method on it.

Expected behavior
You'll see this error in your console.

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

Screenshots or error [logs]
image

Additional context
Just add a

<meta charset="utf-8" />

in the <Head> of the page and the error will go away.
And also please add favicon too.
Thank You and have a great day.

Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.

  • Found the documentation helpful
  • Found documentation but was incomplete
  • Could not find relevant documentation
  • Found the example project helpful
  • Did not find the example project helpful
@balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Feb 9, 2021

Thanks for opening this. Would you care to open a PR to add this?

If it's any consolidation, currently there is no text k nthe page that is "subject to being garbled" 😅. It could change if #1154 gets implemented, so it is a good idea, and an easy fix!

@ExpressGradient
Copy link
Author

@ExpressGradient ExpressGradient commented Feb 9, 2021

Ohh, you mean, you would add a fix for this with #1154? Then oki.
Or else if you want me to do it, I can't find that particular file in this repo. Please direct me to it.
Thenks.

@balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Feb 9, 2021

#1154 is not intended to fix this per se, but it would benefit from adding UTF-8 encoding if we want to support multiple languages with foreign symbols later.

So we use preact to prerender the built-in pages server-side.

Here is the relevant HTML wrapper code:

res.send(`<!DOCTYPE html><head><style type="text/css">${css()}</style><meta name="viewport" content="width=device-width, initial-scale=1"></head><body class="__next-auth-theme-${theme}"><div class="page">${html}</div></body></html>`)

You could add <meta charset="utf-8"> to the head as you suggested.

@balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Feb 26, 2021

@ExpressGradient following up on this, are you interested in making a PR?

@ExpressGradient
Copy link
Author

@ExpressGradient ExpressGradient commented Feb 26, 2021

Ohh, I'm so sorry. I completely forgot about this. To avoid this, I just used the signIn function on my button.
I will definitely do it now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants