Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for dex auth #251

Merged
merged 14 commits into from
Nov 28, 2018

Conversation

maxmarkus
Copy link
Contributor

Improvements which are required for console.

  • allow window.location.origin to be the redirect_uri (prevent routing if access_token is in the url)
  • resilience for invalid iframe (on logout, re-login and)
  • context switcher is now hidden if autologin is disabled and user logged out
  • refactored backdrop due to some oncreate side effects, seems like there is a bug in svelte when using string concatenation inside template

…ss_token or id_token exist in the url, small contextswitcher bug, refactored backdrop since inline if-elses are breaking in svelte oncreate,
…nts-for-dex-auth

# Conflicts:
#	core/src/navigation/services/navigation.js
@@ -288,6 +288,12 @@ const buildRoute = (node, path, params) =>
: buildRoute(node.parent, `/${node.parent.pathSegment}${path}`, params);

export const handleRouteChange = async (path, component, node, config) => {
if (
window.location.href.indexOf('access_token') !== -1 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Can we do this check a bit more specific? At least indexOf('access_token=').
  2. Can we make it configurable? Like list of regex expressions for paths to be ignored by Luigi routing? That way the Luigi app owner would have full control over it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thats a good idea :-)

methods: {
setBackdropClass() {
const baseClasses = 'fd-ui__overlay fd-overlay fd-overlay--modal ';
if (!this.get().backdropActive) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly recommend https://www.npmjs.com/package/classnames for this. It can do exactly the same what this function does but with less code :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less code, but more dependencies. Not a fan of this. I guess if we want to have it, we can write it by ourself with a small helper function. similar to ['class1', 'class2'].join(' ').

@@ -51,6 +53,7 @@
import LogoTitle from './LogoTitle.html';
import Authorization from '../Authorization.html';
import { handleRouteClick } from '../services/routing.js';
import * as Navigation from './services/navigation.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about {isLoggedIn}?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this intentionally to make it easier to distinguish between internal and imported functions, but it is a pure matter of taste.

Copy link
Contributor

@bszwarc bszwarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment.

docs/navigation-configuration.md Outdated Show resolved Hide resolved
pekura and others added 3 commits November 28, 2018 12:13
Co-Authored-By: kwiatekus <6783567+kwiatekus@users.noreply.github.com>
Copy link
Contributor

@bszwarc bszwarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@maxmarkus maxmarkus dismissed parostatkiem-zz’s stale review November 28, 2018 12:03

no actions taken based on the comments, verified with kk

@maxmarkus maxmarkus merged commit 0b761a8 into SAP:master Nov 28, 2018
@maxmarkus maxmarkus deleted the feature/improvements-for-dex-auth branch January 2, 2019 12:28
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
* added possibility for root redirect_uris by disabling routing if access_token or id_token exist in the url, small contextswitcher bug, refactored backdrop since inline if-elses are breaking in svelte oncreate,
* iframe resiliency for logout
* added logout.html and changed logoutUrl, fixed small bugs causing errors
* added skipRoutingForUrlPatterns configuration setting for skipping route handling
* Update docs/navigation-configuration.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants