-
Notifications
You must be signed in to change notification settings - Fork 536
license key activation #1192
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
license key activation #1192
Changes from all commits
b1d80bd
bdfd8d3
edf23b6
c80a088
e6a96c9
1b05bd7
ebbf1c3
123b909
d9427f0
c1e0c3f
06d7963
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,7 @@ | |
| { "url": "http://**" } | ||
| ] | ||
| }, | ||
| "dialog:allow-save" | ||
| "dialog:allow-save", | ||
| "keygen:default" | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,13 @@ pub async fn main() { | |||||||||||||||||||||||||||||
| .plugin(tauri_plugin_membership::init()) | ||||||||||||||||||||||||||||||
| .plugin(tauri_plugin_process::init()) | ||||||||||||||||||||||||||||||
| .plugin(tauri_plugin_global_shortcut::Builder::new().build()) | ||||||||||||||||||||||||||||||
| .plugin( | ||||||||||||||||||||||||||||||
| tauri_plugin_keygen::Builder::new( | ||||||||||||||||||||||||||||||
| "76dfe152-397c-4689-9c5e-3669cefa34b9", | ||||||||||||||||||||||||||||||
| "13f18c98b8c1e5539d92df4aad2d51f4d203d5aead296215df7c3d6376b78b13", | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
| .build(), | ||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||
|
Comment on lines
+102
to
+108
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move product & hash out of source to env/CFG Hard-coding the product UUID and checksum exposes them to the public repo history and requires a new build for every value change. Reading them from - .plugin(
- tauri_plugin_keygen::Builder::new(
- "76dfe152-397c-4689-9c5e-3669cefa34b9",
- "13f18c98b8c1e5539d92df4aad2d51f4d203d5aead296215df7c3d6376b78b13",
- )
- .build(),
- )
+ .plugin(
+ tauri_plugin_keygen::Builder::new(
+ env!("KEYGEN_PRODUCT_ID"),
+ env!("KEYGEN_HASH"),
+ )
+ .build(),
+ )(Adjust to your preferred config mechanism.) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| .plugin(tauri_plugin_autostart::init( | ||||||||||||||||||||||||||||||
| tauri_plugin_autostart::MacosLauncher::LaunchAgent, | ||||||||||||||||||||||||||||||
| Some(vec![]), | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { useEffect } from "react"; | ||
|
|
||
| import { useLicense } from "@/hooks/use-license"; | ||
|
|
||
| export function LicenseRefreshProvider({ children }: { children: React.ReactNode }) { | ||
| const { shouldRefresh, refreshLicense, getLicense } = useLicense(); | ||
|
|
||
| useEffect(() => { | ||
| if (getLicense.isLoading) { | ||
| return; | ||
| } | ||
|
|
||
| const checkAndRefresh = () => { | ||
| if (shouldRefresh() && !refreshLicense.isPending) { | ||
| refreshLicense.mutate({}); | ||
| } | ||
| }; | ||
|
|
||
| checkAndRefresh(); | ||
| const interval = setInterval(checkAndRefresh, 1000 * 60 * 10); // 10min | ||
|
|
||
| return () => clearInterval(interval); | ||
| }, [shouldRefresh, refreshLicense, getLicense.isLoading, refreshLicense.isPending]); | ||
|
|
||
| return <>{children}</>; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.