Refresh nav on auth changes and show session info
This commit is contained in:
@@ -173,8 +173,9 @@ export function loginPageData(store) {
|
||||
return;
|
||||
}
|
||||
const status = error?.cause?.status || error?.status;
|
||||
const isPendingValidation = !store.session?.hasValidated;
|
||||
this.verifyState.error =
|
||||
status === 403
|
||||
status === 403 || isPendingValidation
|
||||
? 'Failed to verify connection. Please verify the application key in Tryton first.'
|
||||
: (error?.message || this.verifyState.error || 'Failed to verify connection.');
|
||||
});
|
||||
|
||||
@@ -27,6 +27,17 @@ export function renderSettingsPage() {
|
||||
<label class="form-label">Database name</label>
|
||||
<input class="form-control" type="text" x-model="form.database" required />
|
||||
</div>
|
||||
<div>
|
||||
<label class="form-label">User login</label>
|
||||
<input class="form-control" type="text" :value="userLogin" readonly />
|
||||
</div>
|
||||
<div>
|
||||
<label class="form-label">Application key</label>
|
||||
<input class="form-control font-monospace" type="text" :value="maskedApplicationKey" readonly />
|
||||
<div class="form-text">
|
||||
Only the first 16 characters are shown for identification.
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary align-self-start" type="submit">Save settings</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -57,6 +68,13 @@ export function settingsPageData(store) {
|
||||
baseUrl: store.config.baseUrl || '',
|
||||
database: store.config.database || '',
|
||||
},
|
||||
get userLogin() {
|
||||
return store.session?.userLogin || '';
|
||||
},
|
||||
get maskedApplicationKey() {
|
||||
const key = store.session?.applicationKey || '';
|
||||
return key ? `${key.slice(0, 16)}...` : '';
|
||||
},
|
||||
save() {
|
||||
store.setConfig({
|
||||
baseUrl: this.form.baseUrl.trim(),
|
||||
|
||||
Reference in New Issue
Block a user