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

Give a better message when not on HTTPS #301

Open
richardanaya opened this issue Oct 22, 2023 · 1 comment
Open

Give a better message when not on HTTPS #301

richardanaya opened this issue Oct 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@richardanaya
Copy link
Contributor

richardanaya commented Oct 22, 2023

This might be confusing to new users who don't know they need to run their dev servers on HTTPS.

@CodyJasonBennett CodyJasonBennett added the enhancement New feature or request label Oct 29, 2023
@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Oct 29, 2023

I believe we already discern HTTPS, but would be good to link to instructions in any case.

react-xr/src/XR.tsx

Lines 363 to 365 in 4d23eb8

const isHttps = location.protocol === 'https:'
setStatus('unsupported')
setReason(isHttps ? 'unknown' : 'https')

react-xr/src/XR.tsx

Lines 327 to 345 in 4d23eb8

const getLabel = (status: XRButtonStatus, mode: XRButtonProps['mode'], reason: XRButtonUnsupportedReason) => {
switch (status) {
case 'entered':
return `Exit ${mode}`
case 'exited':
return `Enter ${mode}`
case 'unsupported':
default:
switch (reason) {
case 'https':
return 'HTTPS needed'
case 'security':
return `${mode} blocked`
case 'unknown':
default:
return `${mode} unsupported`
}
}
}

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

No branches or pull requests

2 participants