Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { AuthenticationContext, adalFetch, withAdalLogin } from 'react-adal';
export const adalConfig = {
clientId: 'c35f7790-574d-4da6-b6d0-be16dca2c51e',
cacheLocation: 'localStorage',
};
export const authContext = new AuthenticationContext(adalConfig);
export const adalApiFetch = (fetch, url, options) =>
adalFetch(authContext, {}, fetch, url, options);
export const withAdalLoginApi = withAdalLogin(authContext, {});
export const adalConfig = {
tenant: process.env.REACT_APP_TENANT_ID,
clientId: process.env.REACT_APP_CLIENT_ID,
endpoints: {
api: ''
},
cacheLocation: 'localStorage' as 'localStorage'
};
export const authContext = new AuthenticationContext(adalConfig);
export const adalApiFetch = (fetch: (input: string, init: any) => Promise, url: string, options: any) =>
adalFetch(authContext, adalConfig.endpoints.api, fetch, url, options);
export const withAdalLoginApi = withAdalLogin(authContext, adalConfig.endpoints.api);