mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Fix for oauth authorization (#4572)
🐛 Fixing credentials response type check that prevented oauth authorization
This commit is contained in:
committed by
GitHub
parent
9b5db8d7be
commit
d06197d879
@@ -118,7 +118,6 @@ import {
|
||||
ICredentialsDecrypted,
|
||||
ICredentialType,
|
||||
INode,
|
||||
INodeCredentialTestResult,
|
||||
INodeParameters,
|
||||
INodeProperties,
|
||||
INodeTypeDescription,
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
import { mapStores } from 'pinia';
|
||||
import Vue from 'vue';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
export default Vue.extend({
|
||||
props: {
|
||||
|
||||
@@ -198,7 +198,10 @@ export default mixins(
|
||||
this.credentialsStore.$subscribe((mutation, state) => {
|
||||
// This data pro stores credential type that the component is currently interested in
|
||||
const credentialType = this.subscribedToCredentialType;
|
||||
const credentialsOfType = this.credentialsStore.allCredentialsByType[credentialType].sort((a, b) => (a.id < b.id ? -1 : 1));
|
||||
let credentialsOfType = this.credentialsStore.allCredentialsByType[credentialType];
|
||||
|
||||
if (credentialsOfType) {
|
||||
credentialsOfType = credentialsOfType.sort((a, b) => (a.id < b.id ? -1 : 1));
|
||||
if (credentialsOfType.length > 0) {
|
||||
// If nothing has been selected previously, select the first one (newly added)
|
||||
if (!this.selected[credentialType]) {
|
||||
@@ -214,6 +217,7 @@ export default mixins(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.subscribedToCredentialType = '';
|
||||
});
|
||||
},
|
||||
|
||||
@@ -10,5 +10,5 @@ export function isNotNull<T>(value: T | null): value is T {
|
||||
}
|
||||
|
||||
export function isValidCredentialResponse(value: unknown): value is ICredentialsResponse {
|
||||
return typeof value === 'object' && value !== null && 'id' in value && 'createdAt' in value && 'updatedAt' in value;
|
||||
return typeof value === 'object' && value !== null && 'id' in value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user