Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3507526
D7312.id24659.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7312.id24659.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -453,18 +453,101 @@
const { secret } = req.params;
const userAgent = req.get('User-Agent');
const detectionResult = detectBrowser(userAgent);
- let redirectUrl = stores.appStoreUrl;
if (detectionResult.os === 'Android OS') {
const isSecretValid = inviteSecretRegex.test(secret);
const referrer = isSecretValid
? `&referrer=${encodeURIComponent(`utm_source=invite/${secret}`)}`
: '';
- redirectUrl = `${stores.googlePlayUrl}${referrer}`;
+ const redirectUrl = `${stores.googlePlayUrl}${referrer}`;
+ res.writeHead(301, {
+ Location: redirectUrl,
+ });
+ res.end();
+ } else {
+ res.end(html`
+ <html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Comm</title>
+ <style>
+ * {
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+ }
+
+ body {
+ background-color: #0a0a0a;
+ color: #ffffff;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ height: 100%;
+ padding: 24px;
+ font-size: 1.6rem;
+ line-height: 1.5;
+ }
+
+ section {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ gap: 16px;
+ }
+
+ h1 {
+ font-size: 3.2rem;
+ line-height: 1.3;
+ margin-top: 32px;
+ }
+
+ .community {
+ background-color: #1f1f1f;
+ padding: 32px;
+ border-radius: 12px;
+ }
+
+ a {
+ all: unset;
+ box-sizing: border-box;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ padding: 24px;
+ border-radius: 4px;
+ border: 1px solid transparent;
+ background-color: #7e57c2;
+ }
+
+ a.secondary {
+ background-color: #0a0a0a;
+ border-color: #808080;
+ }
+ </style>
+ </head>
+ <body>
+ <section>
+ <h1>Comm</h1>
+ <p>
+ To join this community, download the Comm app and reopen this
+ invite link
+ </p>
+ </section>
+ <section class="community">Community Details</section>
+ <section>
+ <a href="${stores.appStoreUrl}">Download Comm</a>
+ <a class="secondary" href="/invite/${secret}">Invite Link</a>
+ </section>
+ </body>
+ </html>
+ `);
}
- res.writeHead(301, {
- Location: redirectUrl,
- });
- res.end();
}
export { websiteResponder, inviteResponder };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 9:08 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2689098
Default Alt Text
D7312.id24659.diff (3 KB)
Attached To
Mode
D7312: [keyserver] Create a page with invite link
Attached
Detach File
Event Timeline
Log In to Comment