@@ -6,19 +6,19 @@ import type {
66 IDataObject ,
77} from 'n8n-workflow' ;
88
9- import { FORWARDED_USER_HEADER , REMOTE_IP_HEADER , SESSION_KEY } from './constants' ;
10- import { cookieParse } from './cookieParser' ;
9+ import { FORWARDED_USER_HEADER , REMOTE_IP_HEADER , SESSION_KEY } from '../common /constants' ;
10+ import { cookieParse } from '../common /cookieParser' ;
1111import { triggerDescription } from './descriptions' ;
1212import { logoutPageHTMLTemplate } from './templates' ;
13- import { getRedisClient } from './transport' ;
14- import type { RedisCredential } from './types' ;
13+ import { getRedisClient } from '../common /transport' ;
14+ import type { RedisCredential } from '../common /types' ;
1515import {
1616 deleteSessionTokenCookie ,
1717 rateLimitConsume ,
1818 redisConnectionTest ,
1919 setSessionTokenCookie ,
2020 validateSessionToken ,
21- } from './utils' ;
21+ } from '../common /utils' ;
2222
2323export class HttpForwardAuthTrigger implements INodeType {
2424 description = triggerDescription ;
@@ -28,8 +28,7 @@ export class HttpForwardAuthTrigger implements INodeType {
2828 } ;
2929
3030 async webhook ( this : IWebhookFunctions ) : Promise < IWebhookResponseData > {
31- const req = this . getRequestObject ( ) ;
32- const res = this . getResponseObject ( ) ;
31+ const [ req , res ] = [ this . getRequestObject ( ) , this . getResponseObject ( ) ] ;
3332 const addResHeader = ( key : string , value : string ) => res . setHeader ( key , value ) ;
3433
3534 const credentials = ( await this . getCredentials ( 'redis' ) ) as RedisCredential ;
@@ -41,7 +40,7 @@ export class HttpForwardAuthTrigger implements INodeType {
4140 const logoutRedirectURL = this . getNodeParameter ( 'logoutRedirectURL' , '' ) as string ;
4241 const enableHTTP = this . getNodeParameter ( 'enableHTTP' , false ) as boolean ;
4342 const rateLimit = this . getNodeParameter ( 'rateLimit' , false ) as boolean ;
44- const remoteIp = rateLimit ? req . headers [ REMOTE_IP_HEADER ] as string : undefined ;
43+ const remoteIp = rateLimit ? ( req . headers [ REMOTE_IP_HEADER ] as string ) : undefined ;
4544 const rateLimitErrorMessage = this . getNodeParameter ( 'rateLimitErrorMessage' , '' ) as string ;
4645 const loginTemplate = this . getNodeParameter ( 'loginTemplate' , '' ) as string ;
4746
0 commit comments