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

fix: newToken work under http #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tmtmtoo
Copy link

@tmtmtoo tmtmtoo commented Dec 19, 2024

#12

During development, there are cases where next.js is accessed over HTTP.
Since browsers cannot use crypto.randomUUID() with HTTP connection, it should fallback to other methods of random number generation, such as Math.random().

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID

@valeryq
Copy link

valeryq commented Jan 6, 2025

@ypresto Hi, can we merge it, please? NextJS supports Safari 12+, but crypto.randomUUID support started only from Safari 15.4, we need earlier support than 15.4.

@ypresto
Copy link
Collaborator

ypresto commented Jan 6, 2025

@tmtmtoo Thank you! We do not need to call crypto.randomUUID() because Math.random() must be always available despite of environment.

@tmtmtoo
Copy link
Author

tmtmtoo commented Jan 7, 2025

@ypresto Thank you for the review. If a simple random string is sufficient as the token specification, how about the implementation in 95a023b?

@peinguin
Copy link
Contributor

@ypresto , could you, please, take a look at the PR?

@Tamicktom
Copy link

Nyaa~~ (≧ω≦)/

Im getting the same error here when testing on a server using HTTP! 🖥️🌐✨ @ypresto senpai, could you pwetty please take a look at this PR? UwU🌸💕

Arigatooo~ 🎀✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants