Changeset 2d66d66 in Klonkt for src/routes/account.js
- Timestamp:
- 07/19/2026 04:17:44 PM (7 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)
- File:
-
- 1 edited
-
src/routes/account.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/account.js
r4407c67 r2d66d66 23 23 import { getPrimarySite } from '../middleware/site.js'; 24 24 import { renderPage } from '../middleware/render.js'; 25 import OAuth from '../services/OAuthService.js'; 26 import { t } from '../services/i18n.js'; 25 27 import { requireAuth } from '../middleware/auth.js'; 26 28 import { toWebp } from '../services/ImageWebpService.js'; … … 75 77 // Display fallback: when you have no own account avatar, show your site's photo. 76 78 siteAvatar: editableSite ? editableSite.profile_photo : null, 79 // OAuth apps (C2S) this user has authorized, so they can revoke them here. 80 authorizations: OAuth.listAuthorizations(req.session.user.id), 77 81 success: req.query.success || null, 78 82 error: req.query.error || null, 79 83 }); 84 }); 85 86 // ==================== REVOKE AN OAUTH APP AUTHORIZATION ==================== 87 router.post('/oauth/revoke', requireAuth, (req, res) => { 88 const lang = req.session.lang || (req.session.user && req.session.user.lang) || 'nl'; 89 const ok = OAuth.revokeAuthorization(req.session.user.id, req.body.token_hash); 90 const msg = ok ? t(lang, 'acct.oauth_revoked') : t(lang, 'acct.oauth_revoke_none'); 91 res.redirect('/account?' + (ok ? 'success' : 'error') + '=' + encodeURIComponent(msg)); 80 92 }); 81 93
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)