mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 15:25:59 +00:00
azure auth
This commit is contained in:
@@ -10,9 +10,10 @@ import DatabaseLoginModal, { isDatabaseLoginVisible } from '../modals/DatabaseLo
|
||||
import _ from 'lodash';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import { openWebLink } from './exportFileTools';
|
||||
import { callServerPing } from './connectionsPinger';
|
||||
import { batchDispatchCacheTriggers, dispatchCacheChange } from './cache';
|
||||
|
||||
export const strmid = uuidv1();
|
||||
const privateApiState = Math.random().toString().substr(2);
|
||||
|
||||
let eventSource;
|
||||
let apiLogging = false;
|
||||
@@ -66,7 +67,7 @@ function processApiResponse(route, args, resp) {
|
||||
|
||||
if (resp?.missingCredentials) {
|
||||
if (resp.detail.redirectToDbLogin) {
|
||||
const state = `dbg-dblogin:${privateApiState}@${resp.detail.conid}`;
|
||||
const state = `dbg-dblogin:${strmid}:${resp.detail.conid}`;
|
||||
localStorage.setItem('dbloginState', state);
|
||||
openWebLink(
|
||||
`connections/dblogin?conid=${resp.detail.conid}&state=${encodeURIComponent(state)}&redirectUri=${
|
||||
@@ -224,8 +225,12 @@ export function getVolatileConnections() {
|
||||
}
|
||||
|
||||
export function installNewVolatileConnectionListener() {
|
||||
apiOn('got-volatile-token', ({ savedConId, volatileConId }) => {
|
||||
apiOn('got-volatile-token', async ({ savedConId, volatileConId }) => {
|
||||
console.log('************************** GOT VOLASTILE TOKEN', savedConId, volatileConId);
|
||||
setVolatileConnectionRemapping(savedConId, volatileConId);
|
||||
await callServerPing();
|
||||
dispatchCacheChange({ key: `server-status-changed` });
|
||||
batchDispatchCacheTriggers(x => x.conid == savedConId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { openedConnections, currentDatabase, openedConnectionsWithTemporary, getCurrentConfig, getOpenedConnections } from '../stores';
|
||||
import { currentDatabase, openedConnectionsWithTemporary, getCurrentConfig, getOpenedConnections } from '../stores';
|
||||
import { apiCall, getVolatileConnections, strmid } from './api';
|
||||
import { getConnectionList } from './metadataLoaders';
|
||||
import hasPermission from '../utility/hasPermission';
|
||||
|
||||
// const doServerPing = async value => {
|
||||
|
||||
Reference in New Issue
Block a user