Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const AddAuthToToolbar = (init: Toolbar | Observable, ctx: ContextApis): Observable => {
return Utils.toObservable(init).map(toolbar => {
toolbar = toolbar || {};
toolbar.tools = [
toolbar.tools,
isLoggedIn()}>
{loggedIn =>
loggedIn ? (
<button> (window.location.href = requests.toAbsURL('/auth/logout'))}>
Log out
</button>
) : (
<button> ctx.navigation.goto(`/login?return_url=${encodeURIComponent(location.href)}`)}>
Log in
</button>
)
}