Changeset 2d66d66 in Klonkt for src/services
- Timestamp:
- 07/19/2026 04:17:44 PM (8 weeks ago)
- Branches:
- main
- Children:
- 33e1dbd
- Parents:
- 4407c67
- git-author:
- Robin <roboburr@…> (07/19/2026 04:17:27 PM)
- git-committer:
- Robin <roboburr@…> (07/19/2026 04:17:44 PM)
- Location:
- src/services
- Files:
-
- 2 edited
-
OAuthService.js (modified) (1 diff)
-
i18n.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/OAuthService.js
r4407c67 r2d66d66 109 109 } 110 110 111 export default { registerClient, getClient, createCode, exchangeCode, verifyBearer, revokeToken, validRedirectUri }; 111 // The active authorizations (bearer tokens) a user has granted, with the app 112 // name and the site each is scoped to. The bearer itself is never stored, so 113 // revocation is keyed on token_hash: safe to render, you cannot derive the 114 // token from its hash. 115 export function listAuthorizations(userId) { 116 return db.prepare(` 117 SELECT t.token_hash, t.site_slug, t.scope, t.created_at, t.last_used_at, c.client_name 118 FROM oauth_tokens t 119 LEFT JOIN oauth_clients c ON c.client_id = t.client_id 120 WHERE t.user_id = ? 121 ORDER BY t.created_at DESC 122 `).all(String(userId || '')); 123 } 124 125 // Revoke one authorization, scoped to the owner so a user can only revoke their 126 // own tokens. Returns true when a row was removed. 127 export function revokeAuthorization(userId, tokenHash) { 128 try { 129 const r = db.prepare('DELETE FROM oauth_tokens WHERE token_hash = ? AND user_id = ?') 130 .run(String(tokenHash || ''), String(userId || '')); 131 return r.changes > 0; 132 } catch { return false; } 133 } 134 135 export default { 136 registerClient, getClient, createCode, exchangeCode, verifyBearer, revokeToken, validRedirectUri, 137 listAuthorizations, revokeAuthorization, 138 }; -
src/services/i18n.js
r4407c67 r2d66d66 744 744 'acct.back_home': 'Terug naar home', 745 745 'acct.title': 'Account', 746 'acct.subtitle': 'Profiel en avatar.', 746 'acct.subtitle': 'Profiel en avatar.', 'acct.oauth_apps': 'Verbonden apps', 'acct.oauth_hint': 'Apps die je toegang tot je account hebt gegeven via OAuth. Trek in wat je niet meer vertrouwt of gebruikt.', 'acct.oauth_none': 'Nog geen apps verbonden.', 'acct.oauth_unknown_app': 'Onbekende app', 'acct.oauth_last_used': 'laatst gebruikt', 'acct.oauth_never': 'nooit', 'acct.oauth_revoke': 'Intrekken', 'acct.oauth_revoked': 'App-toegang ingetrokken.', 'acct.oauth_revoke_none': 'Die toegang bestond niet meer.', 747 747 'acct.viewer_mode': 'Kijker-modus', 748 748 'acct.viewer_note': 'Dit is een demo-account. Je kunt alles bekijken, maar niets wijzigen — ook geen foto of bio.', … … 1671 1671 'acct.back_home': 'Back to home', 1672 1672 'acct.title': 'Account', 1673 'acct.subtitle': 'Profile and avatar.', 1673 'acct.subtitle': 'Profile and avatar.', 'acct.oauth_apps': 'Connected apps', 'acct.oauth_hint': 'Apps you granted access to your account via OAuth. Revoke anything you no longer trust or use.', 'acct.oauth_none': 'No apps connected yet.', 'acct.oauth_unknown_app': 'Unknown app', 'acct.oauth_last_used': 'last used', 'acct.oauth_never': 'never', 'acct.oauth_revoke': 'Revoke', 'acct.oauth_revoked': 'App access revoked.', 'acct.oauth_revoke_none': 'That access no longer existed.', 1674 1674 'acct.viewer_mode': 'Viewer mode', 1675 1675 'acct.viewer_note': 'This is a demo account. You can view everything, but change nothing — not even your photo or bio.', … … 2598 2598 'acct.back_home': 'Zurück zur Startseite', 2599 2599 'acct.title': 'Konto', 2600 'acct.subtitle': 'Profil und Avatar.', 2600 'acct.subtitle': 'Profil und Avatar.', 'acct.oauth_apps': 'Verbundene Apps', 'acct.oauth_hint': 'Apps, denen du \u00fcber OAuth Zugriff auf dein Konto gegeben hast. Widerrufe, was du nicht mehr vertraust oder nutzt.', 'acct.oauth_none': 'Noch keine Apps verbunden.', 'acct.oauth_unknown_app': 'Unbekannte App', 'acct.oauth_last_used': 'zuletzt genutzt', 'acct.oauth_never': 'nie', 'acct.oauth_revoke': 'Widerrufen', 'acct.oauth_revoked': 'App-Zugriff widerrufen.', 'acct.oauth_revoke_none': 'Dieser Zugriff bestand nicht mehr.', 2601 2601 'acct.viewer_mode': 'Betrachter-Modus', 2602 2602 'acct.viewer_note': 'Dies ist ein Demo-Konto. Du kannst alles ansehen, aber nichts ändern — auch kein Foto oder keine Bio.',
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)