~cadence/Frames

882d2823ef17a29a0e7a86f884503f3849ab5ceb — Cadence Ember 1 year, 9 months ago b130231
Fix when both users are on the same instance
1 files changed, 4 insertions(+), 1 deletions(-)

M utils/auth.js
M utils/auth.js => utils/auth.js +4 -1
@@ 103,7 103,10 @@ async function doAuth(req, handle) {
	const results = await framer.client.searchAccount(viewer.row.handle, {limit: 10, resolve: true})
	// console.log("results")
	// console.log(results)
	const result = results.data.find(r => r.acct === viewer.row.handle.slice(1))
	// if both users are on the same instance, acct search results has no domain
	let viewerAcct = viewer.row.handle.slice(1)
	if (framer.domain === viewer.domain) viewerAcct = viewerAcct.replace(/@[^@]+$/, "")
	const result = results.data.find(r => r.acct === viewerAcct)
	// console.log("found")
	// console.log(result)
	if (!result) throw statuses.NOT_FOLLOWING