mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Add postAuthenticate hook for source control preferences (no-changelog) (#6629)
* feat: handle source control settings in post-authenticate app hook * fix: only trigger post authenticate when logging in * chore: remove console.log * chore: fix linting issues * test: update source control test
This commit is contained in:
@@ -92,6 +92,7 @@ export default defineComponent({
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
postAuthenticateDone: false,
|
||||
loading: true,
|
||||
};
|
||||
},
|
||||
@@ -215,6 +216,21 @@ export default defineComponent({
|
||||
} catch {}
|
||||
}, CLOUD_TRIAL_CHECK_INTERVAL);
|
||||
},
|
||||
async postAuthenticate() {
|
||||
if (this.postAuthenticateDone) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.usersStore.currentUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.sourceControlStore.isEnterpriseSourceControlEnabled) {
|
||||
await this.sourceControlStore.getPreferences();
|
||||
}
|
||||
|
||||
this.postAuthenticateDone = true;
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
this.setTheme();
|
||||
@@ -224,10 +240,7 @@ export default defineComponent({
|
||||
this.redirectIfNecessary();
|
||||
void this.checkForNewVersions();
|
||||
void this.checkForCloudPlanData();
|
||||
|
||||
if (this.sourceControlStore.isEnterpriseSourceControlEnabled) {
|
||||
await this.sourceControlStore.getPreferences();
|
||||
}
|
||||
void this.postAuthenticate();
|
||||
|
||||
this.loading = false;
|
||||
|
||||
@@ -239,6 +252,11 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'usersStore.currentUser'(currentValue, previousValue) {
|
||||
if (currentValue && !previousValue) {
|
||||
void this.postAuthenticate();
|
||||
}
|
||||
},
|
||||
$route(route) {
|
||||
this.authenticate();
|
||||
this.redirectIfNecessary();
|
||||
|
||||
Reference in New Issue
Block a user