mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 06:44:05 +08:00
fix
This commit is contained in:
@@ -18,6 +18,8 @@ const providerIcons: Record<string, string> = {
|
||||
gitlab: "https://gitlab.com/assets/favicon-72a2cad5025aa931d6ea56c3201d1f18e68a8571da3c2571592f63571e0c5571.png",
|
||||
jira: "https://wac-cdn.atlassian.com/assets/img/favicons/atlassian/favicon.png",
|
||||
linear: "https://linear.app/favicon.ico",
|
||||
google_docs: "https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico",
|
||||
figma: "https://static.figma.com/app/icon/1/favicon.png",
|
||||
};
|
||||
|
||||
function IntegrationLinkView(props: any) {
|
||||
|
||||
@@ -4,4 +4,6 @@ export enum IntegrationType {
|
||||
GITLAB = 'gitlab',
|
||||
JIRA = 'jira',
|
||||
LINEAR = 'linear',
|
||||
GOOGLE_DOCS = 'google_docs',
|
||||
FIGMA = 'figma',
|
||||
}
|
||||
|
||||
@@ -75,11 +75,11 @@ export class OAuthController {
|
||||
);
|
||||
|
||||
const appUrl = this.environmentService.getAppUrl();
|
||||
return res.redirect(`${appUrl}/settings/integrations`);
|
||||
return res.redirect(`${appUrl}/settings/integrations`, 302).send();
|
||||
} catch (err) {
|
||||
this.logger.error(`OAuth callback error for ${type}: ${(err as Error).message}`);
|
||||
const appUrl = this.environmentService.getAppUrl();
|
||||
return res.redirect(`${appUrl}/settings/integrations?error=oauth_failed`);
|
||||
return res.redirect(`${appUrl}/settings/integrations?error=oauth_failed`, 302).send();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@ import { IntegrationRegistry } from '../registry/integration-registry';
|
||||
import { IntegrationConnectionRepo } from '../repos/integration-connection.repo';
|
||||
import { IntegrationRepo } from '../repos/integration.repo';
|
||||
import { OAuthService } from '../oauth/oauth.service';
|
||||
import { UnfurlResult, IntegrationProvider } from '../registry/integration-provider.interface';
|
||||
import {
|
||||
UnfurlResult,
|
||||
IntegrationProvider,
|
||||
} from '../registry/integration-provider.interface';
|
||||
import { RedisService } from '@nestjs-labs/nestjs-ioredis';
|
||||
import type { Redis } from 'ioredis';
|
||||
import * as crypto from 'crypto';
|
||||
@@ -38,6 +41,7 @@ export class UnfurlService {
|
||||
}
|
||||
|
||||
const resolved = await this.resolveProvider(url, workspaceId);
|
||||
|
||||
if (!resolved) {
|
||||
return null;
|
||||
}
|
||||
@@ -58,7 +62,8 @@ export class UnfurlService {
|
||||
}
|
||||
|
||||
try {
|
||||
const accessToken = await this.oauthService.getValidAccessToken(connection);
|
||||
const accessToken =
|
||||
await this.oauthService.getValidAccessToken(connection);
|
||||
|
||||
const unfurlResult = await provider.unfurl({
|
||||
url,
|
||||
@@ -123,7 +128,11 @@ export class UnfurlService {
|
||||
}
|
||||
|
||||
private buildCacheKey(workspaceId: string, url: string): string {
|
||||
const hash = crypto.createHash('sha256').update(url).digest('hex').slice(0, 16);
|
||||
const hash = crypto
|
||||
.createHash('sha256')
|
||||
.update(url)
|
||||
.digest('hex')
|
||||
.slice(0, 16);
|
||||
return `${UNFURL_CACHE_PREFIX}${workspaceId}:${hash}`;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
Submodule apps/server/src/ee updated: 41b27c951f...010a833e1a
Reference in New Issue
Block a user