Commit dba42d5
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
File tree
- open-pdf-studio
- js
- i18n/locales
- ar
- bg
- bn
- ca
- cs
- da
- de
- el
- en
- es
- fa
- fi
- fr
- he
- hi
- hr
- hu
- id
- it
- ja
- ko
- ms
- nb
- nl
- pl
- pt
- ro
- ru
- sk
- sr
- sv
- sw
- ta
- th
- tr
- uk
- ur
- vi
- zh
- services
- solid
- components
- dialogs
- ribbon
- stores
- tools
- types
- scripts
- src-tauri
- capabilities
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
263 | | - | |
264 | 264 | | |
| 265 | + | |
265 | 266 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
0 commit comments