mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Supabase Node): Send token also via Authorization Bearer (#2814)
Send Authorization Bearer in headers Fix typo in validateCredentials function
This commit is contained in:
@@ -24,6 +24,7 @@ export async function supabaseApiRequest(this: IExecuteFunctions | IExecuteSingl
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
apikey: credentials.serviceRole,
|
||||
Authorization: 'Bearer ' + credentials.serviceRole,
|
||||
Prefer: 'return=representation',
|
||||
},
|
||||
method,
|
||||
@@ -296,7 +297,7 @@ export const buildGetQuery = (obj: IDataObject, value: IDataObject) => {
|
||||
return Object.assign(obj, { [`${value.keyName}`]: `eq.${value.keyValue}` });
|
||||
};
|
||||
|
||||
export async function validateCrendentials(
|
||||
export async function validateCredentials(
|
||||
this: ICredentialTestFunctions,
|
||||
decryptedCredentials: ICredentialDataDecryptedObject): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
@@ -309,6 +310,7 @@ export async function validateCrendentials(
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
apikey: serviceRole,
|
||||
Authorization: 'Bearer ' + serviceRole,
|
||||
},
|
||||
method: 'GET',
|
||||
uri: `${credentials.host}/rest/v1/`,
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
buildOrQuery,
|
||||
buildQuery,
|
||||
supabaseApiRequest,
|
||||
validateCrendentials,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import {
|
||||
@@ -106,7 +106,7 @@ export class Supabase implements INodeType {
|
||||
credentialTest: {
|
||||
async supabaseApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
try {
|
||||
await validateCrendentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
|
||||
Reference in New Issue
Block a user