Skip to content

Commit dba42d5

Browse files
committed
feat: OIDC sign-in, titlebar account menu, gateway-backed AI credits (v1.44.0)
Replaces the app's self-contained auth/billing stack with Impertio Accounts OIDC. All user identity, plan subscriptions, and credit balances now live on account.impertio.app — the desktop app's only job is to sign the user in via Authorization Code + PKCE and attach the resulting access token to /v1/chat calls. Rust (src-tauri): - auth.rs — new OIDC module: PKCE loopback on 127.0.0.1:53683, tokens persisted via tauri-plugin-store, /oauth/userinfo proxy for plan + credits. Commands: auth_login, auth_logout, auth_current_user, auth_get_access_token, auth_userinfo, auth_is_configured. - Cargo.toml — added oauth2, tiny_http, url, tokio (sync), and tauri-plugin-store. - capabilities/default.json — added store:default. - lib.rs — registers the store plugin + the 6 auth commands. Frontend: - js/services/ai-api.js rewritten: no more register/login/refresh/me/ billing/usage endpoints; token comes from Rust via invoke('auth_get_access_token'). Chat API surface unchanged. - js/solid/stores/aiStore.js rewritten: login() triggers the OIDC browser flow; refreshUserData() pulls /oauth/userinfo for plan + credits. New requireSignIn() helper for gated actions. - AILoginDialog.jsx + AIPlanDialog.jsx deleted. All callers now go through requireSignIn() which kicks off the browser OIDC flow when the user isn't signed in yet. - AccountDropdown.jsx rewritten: signed-out = single sign-in button; signed-in = avatar, name + email, plan badge, credits count with reset date, Manage account link (to account.impertio.app/billing), Upgrade link (for free tier, to .../pricing), Sign out. - js/types/ai.ts — types now match the /userinfo response shape (subscription.tier + credits.total/monthly/topup/resets_at). i18n: - 7 new keys (credits, creditsResetsAt, planFree/Pro/Studio, upgrade, manageAccount) added to all 39 locales via scripts/_add_oidc_i18n.py. English defaults for locales without native strings. Version bump 1.43.0 -> 1.44.0 (package.json, Cargo.toml, tauri.conf.json).
1 parent 5738c47 commit dba42d5

60 files changed

Lines changed: 1564 additions & 531 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

open-pdf-studio/js/bridge.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export {
252252
setAiPanelVisible,
253253
isAuthenticated as aiIsAuthenticated,
254254
user as aiUser,
255+
info as aiInfo,
255256
usage as aiUsage,
256257
subscription as aiSubscription,
257258
messages as aiMessages,
@@ -260,6 +261,6 @@ export {
260261
sendChat as aiSendChat,
261262
clearChat as aiClearChat,
262263
login as aiLogin,
263-
register as aiRegister,
264264
logout as aiLogout,
265+
requireSignIn as aiRequireSignIn,
265266
} from './solid/stores/aiStore.js';

open-pdf-studio/js/i18n/locales/ar/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "رصيد",
66+
"creditsResetsAt": "إعادة تعيين {{date}}",
67+
"planFree": "مجاني",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "ترقية",
71+
"manageAccount": "إدارة الحساب"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/bg/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "кредити",
66+
"creditsResetsAt": "Нулиране {{date}}",
67+
"planFree": "Безплатен",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Надстройте",
71+
"manageAccount": "Управление на акаунта"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/bn/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "ক্রেডিট",
66+
"creditsResetsAt": "{{date}} এ রিসেট",
67+
"planFree": "ফ্রি",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "আপগ্রেড",
71+
"manageAccount": "অ্যাকাউন্ট পরিচালনা"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/ca/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "crèdits",
66+
"creditsResetsAt": "Es reinicia el {{date}}",
67+
"planFree": "Gratuït",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Millorar",
71+
"manageAccount": "Gestiona el compte"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/cs/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "kredity",
66+
"creditsResetsAt": "Obnovení {{date}}",
67+
"planFree": "Zdarma",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Upgradovat",
71+
"manageAccount": "Spravovat účet"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/da/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "kreditter",
66+
"creditsResetsAt": "Nulstilles {{date}}",
67+
"planFree": "Gratis",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Opgrader",
71+
"manageAccount": "Administrer konto"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/de/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "Credits",
66+
"creditsResetsAt": "Zurückgesetzt am {{date}}",
67+
"planFree": "Kostenlos",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Upgrade",
71+
"manageAccount": "Konto verwalten"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/el/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@
6161
"expand": "Expand",
6262
"pinToSide": "Pin to side",
6363
"unpin": "Unpin",
64-
"copy": "Copy"
64+
"copy": "Copy",
65+
"credits": "πιστώσεις",
66+
"creditsResetsAt": "Επαναφορά {{date}}",
67+
"planFree": "Δωρεάν",
68+
"planPro": "Pro",
69+
"planStudio": "Studio",
70+
"upgrade": "Αναβάθμιση",
71+
"manageAccount": "Διαχείριση λογαριασμού"
6572
},
6673
"measure": {
6774
"scale": "Scale",

open-pdf-studio/js/i18n/locales/en/ribbon.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@
6666
"expand": "Expand",
6767
"pinToSide": "Pin to side",
6868
"unpin": "Unpin",
69-
"copy": "Copy"
69+
"copy": "Copy",
70+
"credits": "credits",
71+
"creditsResetsAt": "Resets {{date}}",
72+
"planFree": "Free",
73+
"planPro": "Pro",
74+
"planStudio": "Studio",
75+
"upgrade": "Upgrade",
76+
"manageAccount": "Manage account"
7077
},
7178
"measure": {
7279
"scale": "Scale",

0 commit comments

Comments
 (0)