-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c33ba4b
commit 4e77f8c
Showing
8 changed files
with
6,008 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import bearFactory, { | ||
FixedLoginAndPasswordAuthProvider, | ||
ContextDeferredAuthProvider, | ||
AnonymousAuthProvider, | ||
} from "@gooddata/sdk-backend-bear"; | ||
|
||
import { backend as hostname } from "../../constants"; | ||
import { backend } from "../../constants"; | ||
|
||
const backendConfig = process.env.REACT_APP_SET_HOSTNAME ? { hostname } : {}; | ||
export const createBackend = () => | ||
bearFactory({ hostname: backend }).withAuthentication(new AnonymousAuthProvider()); | ||
|
||
export const createBackend = () => { | ||
return bearFactory(backendConfig).withAuthentication(new ContextDeferredAuthProvider()); | ||
}; | ||
|
||
export const backendWithCredentials = (backend, username, password) => { | ||
return backend.withAuthentication(new FixedLoginAndPasswordAuthProvider(username, password)); | ||
}; | ||
export const backendWithCredentials = (backend, username, password) => | ||
backend.withAuthentication(new FixedLoginAndPasswordAuthProvider(username, password)); |
Oops, something went wrong.