azure auth WIP

This commit is contained in:
Jan Prochazka
2024-08-02 14:32:28 +02:00
parent f777530b1c
commit fc448ed578
10 changed files with 91 additions and 20 deletions

View File

@@ -31,7 +31,8 @@
$: showConnectionFieldArgs = { config: $config };
$: showUser = driver?.showConnectionField('user', $values, showConnectionFieldArgs) && $values.passwordMode != 'askUser';
$: showUser =
driver?.showConnectionField('user', $values, showConnectionFieldArgs) && $values.passwordMode != 'askUser';
$: showPassword =
driver?.showConnectionField('password', $values, showConnectionFieldArgs) &&
$values.passwordMode != 'askPassword' &&
@@ -83,17 +84,19 @@
{/if}
{#if $authTypes && driver?.showConnectionField('authType', $values, showConnectionFieldArgs)}
<FormSelectField
label={driver?.authTypeLabel ?? 'Authentication'}
name="authType"
isNative
disabled={isConnected}
defaultValue={driver?.defaultAuthTypeName}
options={$authTypes.map(auth => ({
value: auth.name,
label: auth.title,
}))}
/>
{#key $authTypes}
<FormSelectField
label={driver?.authTypeLabel ?? 'Authentication'}
name="authType"
isNative
disabled={isConnected}
defaultValue={driver?.defaultAuthTypeName}
options={$authTypes.map(auth => ({
value: auth.name,
label: auth.title,
}))}
/>
{/key}
{/if}
{#if driver?.showConnectionField('clientLibraryPath', $values, showConnectionFieldArgs)}

View File

@@ -9,6 +9,7 @@ import { showModal } from '../modals/modalTools';
import DatabaseLoginModal, { isDatabaseLoginVisible } from '../modals/DatabaseLoginModal.svelte';
import _ from 'lodash';
import uuidv1 from 'uuid/v1';
import { openWebLink } from './exportFileTools';
export const strmid = uuidv1();
@@ -63,7 +64,9 @@ function processApiResponse(route, args, resp) {
// }
if (resp?.missingCredentials) {
if (!isDatabaseLoginVisible()) {
if (resp.detail.redirectToDbLogin) {
openWebLink('connections/dblogin');
} else if (!isDatabaseLoginVisible()) {
showModal(DatabaseLoginModal, resp.detail);
}
return null;