Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33105954
D7312.1768476791.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D7312.1768476791.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,137 @@
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`
+ <!DOCTYPE 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;
+ }
+
+ html {
+ height: 100%;
+ }
+
+ body {
+ font-family: 'Inter', -apple-system, 'Segoe UI', 'Roboto',
+ 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
+ 'Helvetica Neue', ui-sans-serif;
+ background-color: #0a0a0a;
+ color: #ffffff;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
+ align-items: center;
+ height: 100%;
+ padding: 1.6rem;
+ font-size: 1.8rem;
+ line-height: 2.4rem;
+ font-weight: 400;
+ }
+
+ section {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ }
+
+ .card {
+ width: 100%;
+ padding: 3.2rem 1.2rem;
+ gap: 4rem;
+ background-color: #1f1f1f;
+ border-radius: 1.6rem;
+ }
+
+ .buttons {
+ gap: 1.2rem;
+ }
+
+ h1 {
+ font-size: 3.6rem;
+ line-height: 1.5;
+ font-weight: 500;
+ }
+
+ p {
+ text-align: center;
+ }
+
+ .separator {
+ border: 1px solid #404040;
+ width: 100%;
+ }
+
+ .button {
+ all: unset;
+ box-sizing: border-box;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ padding: 1.7rem;
+ border-radius: 0.4rem;
+ border: 1px solid transparent;
+ background-color: #6d49ab;
+ }
+
+ .button.secondary {
+ background-color: #1f1f1f;
+ border-color: #ffffff;
+ }
+
+ .link {
+ all: unset;
+ box-sizing: border-box;
+ text-decoration-line: underline;
+ }
+ </style>
+ </head>
+ <body>
+ <div></div>
+ <section class="card">
+ <section>
+ Icon
+ <h1>Comm</h1>
+ </section>
+ <p>
+ To join this community, download the Comm app and reopen this
+ invite link
+ </p>
+ <div class="separator"></div>
+ <section class="buttons">
+ <a class="button" href="${stores.appStoreUrl}">Download Comm</a>
+ <a class="button secondary" href="/invite/${secret}">
+ Invite Link
+ </a>
+ </section>
+ </section>
+ <a class="link" href="https://comm.app/">Visit Comm’s website</a>
+ </body>
+ </html>
+ `);
}
- res.writeHead(301, {
- Location: redirectUrl,
- });
- res.end();
}
export { websiteResponder, inviteResponder };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 15, 11:33 AM (15 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5937596
Default Alt Text
D7312.1768476791.diff (4 KB)
Attached To
Mode
D7312: [keyserver] Create a page with invite link
Attached
Detach File
Event Timeline
Log In to Comment