Skip to content

Commit

Permalink
fallback prompt for copy button in insecure contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
henrygd committed Jul 24, 2024
1 parent 345dbeb commit ee57e84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hub/site/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ export async function copyToClipboard(content: string) {
description: 'Copied to clipboard',
})
} catch (e: any) {
toast({
duration,
description: 'Failed to copy',
})
prompt(
'Automatic copy requires a secure context (https, localhost, or *.localhost). Please copy manually:',
content
)
}
}

const verifyAuth = () => {
pb.collection('users')
.authRefresh()
Expand Down

0 comments on commit ee57e84

Please sign in to comment.