Changeset bf72108 in Klonkt
- Timestamp:
- 07/19/2026 04:04:25 AM (7 weeks ago)
- Branches:
- main
- Children:
- 4407c67
- Parents:
- dd568e7
- git-author:
- Robin <roboburr@…> (07/19/2026 04:04:05 AM)
- git-committer:
- Robin <roboburr@…> (07/19/2026 04:04:25 AM)
- Files:
-
- 4 edited
-
CHANGELOG.de.md (modified) (1 diff)
-
CHANGELOG.md (modified) (1 diff)
-
CHANGELOG.nl.md (modified) (1 diff)
-
src/routes/oauth.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG.de.md
rdd568e7 rbf72108 28 28 29 29 ### Behoben 30 - **OAuth-Zustimmung übergibt jetzt zuverlässig an native Apps.** Nach 31 Allow/Deny war die Weiterleitung an ein natives Custom-Scheme (z. B. 32 `com.klonkt.shaer:/oauth`) ein einfacher 302, den mobile Browser stillschweigend 33 verwerfen. Der Zustimmungsschritt liefert nun eine kleine Zwischenseite für 34 Nicht-http-Redirect-URIs, die automatisch weiterleitet und einen "App öffnen"- 35 Tipp-Link bietet (ein Tipp startet die App auf Android zuverlässig; iOS' 36 Web-Auth-Session fängt sie ohnehin ab). Web-Clients (http/https) bekommen 37 weiterhin einen 302. 30 38 - **Besucher können auf die eigenen Kommentare des Seiteninhabers antworten.** 31 39 Der Knopf "über das Fediverse antworten" erschien nur bei Kommentaren anderer; -
CHANGELOG.md
rdd568e7 rbf72108 26 26 27 27 ### Fixed 28 - **OAuth consent now hands off reliably to native apps.** After Allow/Deny, a 29 redirect to a native custom scheme (e.g. `com.klonkt.shaer:/oauth`) was a plain 30 302, which mobile browsers silently drop. The consent step now serves a tiny 31 interstitial for non-http redirect URIs that auto-forwards and offers an "Open 32 the app" tap link (a tap reliably launches the app on Android; iOS's web-auth 33 session intercepts either way). Web (http/https) clients still get a 302. 28 34 - **Visitors can reply to the site owner's own comments.** The "reply via the 29 35 fediverse" button only appeared on comments from others; the site's own -
CHANGELOG.nl.md
rdd568e7 rbf72108 27 27 28 28 ### Opgelost 29 - **OAuth-toestemming geeft nu betrouwbaar over aan native apps.** Na Allow/Deny 30 was de redirect naar een native custom-scheme (bijv. `com.klonkt.shaer:/oauth`) 31 een gewone 302, en die negeren mobiele browsers stilzwijgend. De toestemmings- 32 stap serveert nu een klein tussenscherm voor niet-http redirect-URI's dat 33 automatisch doorstuurt én een "Open de app"-tikknop biedt (een tik opent de app 34 betrouwbaar op Android; iOS' web-auth-sessie vangt 'm sowieso op). Web-clients 35 (http/https) krijgen nog steeds een 302. 29 36 - **Bezoekers kunnen reageren op de eigen reacties van de site-eigenaar.** De 30 37 knop "reageer via de fediverse" verscheen alleen bij reacties van anderen; bij -
src/routes/oauth.js
rdd568e7 rbf72108 45 45 } 46 46 47 // Hand control back to the client at redirect_uri + params. For a web client 48 // (http/https) a plain 302 is right. For a NATIVE custom scheme 49 // (com.klonkt.shaer:/oauth) a 302 is unreliable: mobile browsers routinely drop 50 // a server redirect to a custom scheme (no user gesture). So we serve a tiny 51 // interstitial that both auto-forwards AND offers a tap link — a tap is a user 52 // gesture that launches the app on Android, and iOS's ASWebAuthenticationSession 53 // intercepts either navigation. Same page for allow and deny (neutral copy). 54 function finishRedirect(res, redirectUri, params) { 55 const target = redirectWith(redirectUri, params); 56 if (/^https?:\/\//i.test(redirectUri)) return res.redirect(target); 57 const attr = target.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<'); 58 return res.type('html').send(`<!doctype html> 59 <html lang="en"><head><meta charset="utf-8"> 60 <meta name="viewport" content="width=device-width,initial-scale=1"> 61 <meta http-equiv="refresh" content="0;url=${attr}"> 62 <title>Return to the app</title> 63 <style>body{font-family:system-ui,-apple-system,sans-serif;background:#111;color:#eee;margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;text-align:center} 64 .box{padding:1.5rem}p{color:#aaa;line-height:1.5}a.btn{display:inline-block;margin-top:1.2rem;padding:.85rem 1.7rem;border-radius:12px;background:#5A32E6;color:#fff;text-decoration:none;font-weight:700}</style> 65 </head><body><div class="box"> 66 <p>Almost done. If the app doesn't open by itself:</p> 67 <a class="btn" href="${attr}">Open the app</a> 68 </div> 69 <script>location.replace(${JSON.stringify(target)});</script> 70 </body></html>`); 71 } 72 47 73 // Bounce back to the client with an OAuth error (RFC 6749 §4.1.2.1) when we have 48 74 // a validated redirect_uri; otherwise render a plain error (open-redirect guard). 49 75 function authError(res, redirectUri, state, error, desc) { 50 if (redirectUri) return res.redirect(redirectWith(redirectUri, { error, error_description: desc, state }));76 if (redirectUri) return finishRedirect(res, redirectUri, { error, error_description: desc, state }); 51 77 return res.status(400).json({ error, error_description: desc }); 52 78 } … … 111 137 }); 112 138 if (out.error) return authError(res, redirect_uri, state, out.error, out.error_description); 113 return res.redirect(redirectWith(redirect_uri, { code: out.code, state }));139 return finishRedirect(res, redirect_uri, { code: out.code, state }); 114 140 }); 115 141
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)