Page MenuHomePhabricator

D8255.diff
No OneTemporary

D8255.diff

diff --git a/keyserver/.well-known/apple-app-site-association b/keyserver/.well-known/apple-app-site-association
--- a/keyserver/.well-known/apple-app-site-association
+++ b/keyserver/.well-known/apple-app-site-association
@@ -9,13 +9,13 @@
"appIDs": [ "H98Y8MH53M.app.comm" ],
"components": [
{
- "/": "*"
+ "/": "/invite/*"
}
]
},
{
"appID": "H98Y8MH53M.app.comm",
- "paths": [ "*" ]
+ "paths": [ "/invite/*" ]
}
]
}
diff --git a/keyserver/src/keyserver.js b/keyserver/src/keyserver.js
--- a/keyserver/src/keyserver.js
+++ b/keyserver/src/keyserver.js
@@ -109,6 +109,8 @@
downloadHandler(uploadDownloadResponder),
);
+ router.get('/invite/:secret', inviteResponder);
+
// $FlowFixMe express-ws has side effects that can't be typed
router.ws('/ws', onConnection);
router.get('/worker/:worker', webWorkerResponder);
@@ -127,15 +129,11 @@
// and prevent commAppRouter and landingRouter from working correctly. So we
// make sure that squadCalRouter goes last
- // This endpoint should be handled by the mobile app. If the server
- // receives this request, it means that the app is not installed and we
- // should redirect the user to a place from which the app can be
- // downloaded. It's important to define it before any other router so that
- // it won't get handled by e.g. `/` rule.
server.get('/invite/:secret', inviteResponder);
if (landingBaseRoutePath) {
const landingRouter = express.Router();
+ landingRouter.get('/invite/:secret', inviteResponder);
landingRouter.use('/images', express.static('images'));
landingRouter.use('/fonts', express.static('fonts'));
landingRouter.use(
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
@@ -608,6 +608,8 @@
const inviteSecretRegex = /^[a-z0-9]+$/i;
+// On native, if this responder is called, it means that the app isn't
+// installed.
async function inviteResponder(req: $Request, res: $Response): Promise<void> {
const { secret } = req.params;
const userAgent = req.get('User-Agent');
@@ -624,8 +626,10 @@
res.end();
return;
} else if (detectionResult.os !== 'iOS') {
- const baseRoutePath = getCommAppURLFacts()?.baseRoutePath;
- const redirectUrl = `${baseRoutePath ?? '/'}handle/invite/${secret}`;
+ const urlFacts = getCommAppURLFacts();
+ const baseDomain = urlFacts?.baseDomain ?? '';
+ const basePath = urlFacts?.basePath ?? '/';
+ const redirectUrl = `${baseDomain}${basePath}handle/invite/${secret}`;
res.writeHead(301, {
Location: redirectUrl,
});
@@ -780,7 +784,10 @@
<div class="separator"></div>
<section class="buttons">
<a class="button" href="${stores.appStoreUrl}">Download Comm</a>
- <a class="button secondary" href="/invite/${secret}">
+ <a
+ class="button secondary"
+ href="https://comm.app/invite/${secret}"
+ >
Invite Link
</a>
</section>
diff --git a/native/android/app/src/main/AndroidManifest.xml b/native/android/app/src/main/AndroidManifest.xml
--- a/native/android/app/src/main/AndroidManifest.xml
+++ b/native/android/app/src/main/AndroidManifest.xml
@@ -65,7 +65,9 @@
<data
android:scheme="https"
- android:host="web.comm.app" />
+ android:host="comm.app"
+ android:pathPrefix="/invite"
+ />
</intent-filter>
</activity>
<activity
diff --git a/native/ios/Comm/Comm.entitlements b/native/ios/Comm/Comm.entitlements
--- a/native/ios/Comm/Comm.entitlements
+++ b/native/ios/Comm/Comm.entitlements
@@ -6,7 +6,7 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
- <string>applinks:web.comm.app</string>
+ <string>applinks:comm.app</string>
</array>
<key>com.apple.security.application-groups</key>
<array>

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 6:30 PM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2601940
Default Alt Text
D8255.diff (4 KB)

Event Timeline