mirror of
https://github.com/docmost/docmost.git
synced 2026-07-14 12:56:44 +10:00
fix
This commit is contained in:
@@ -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