mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08: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:
parent
b9aa440be3
commit
5774dd8885
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue