Skip to content

Commit

Permalink
Remove ie leftovers (#3833)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDoberer authored Jul 29, 2024
1 parent 259a7ed commit f30a186
Show file tree
Hide file tree
Showing 27 changed files with 413 additions and 415 deletions.
3 changes: 1 addition & 2 deletions client/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ class Helpers {
* @private
*/
getRandomId() {
// window.msCrypto for IE 11
return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

/**
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-react/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Luigi Simple React App</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-vue/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>luigi-example-vue</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion core/examples/luigi-example-vue/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>luigi-example-vue</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/GlobalNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@
width: 0; /* chrome, safari */
}
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
.fd-side-nav__utility {
margin-top: 0;
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/LeftNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,6 @@
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:global(html.luigi-app-in-custom-container) {
Expand Down
1 change: 0 additions & 1 deletion core/src/navigation/LeftNavGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
.fd-navigation__link {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
Expand Down
1 change: 0 additions & 1 deletion core/src/styles/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@mixin transition($args...) {
-webkit-transition: $args;
-moz-transition: $args;
-ms-transition: $args;
-o-transition: $args;
transition: $args;
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/utilities/helpers/generic-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class GenericHelpersClass {
* @private
*/
getRandomId /* istanbul ignore next */() {
// window.msCrypto for IE 11
return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

/**
Expand Down
1 change: 0 additions & 1 deletion cra-template/template/public/sampleapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Luigi Simple React App</title>
</head>
Expand Down
51 changes: 14 additions & 37 deletions plugins/auth/src/auth-oauth2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export default class oAuth2ImplicitGrant {
constructor(settings = {}) {
const defaultSettings = {
oAuthData: {
redirect_uri:
window.location.origin + '/assets/auth-oauth2/callback.html',
redirect_uri: window.location.origin + '/assets/auth-oauth2/callback.html',
response_type: 'id_token token',
scope: ''
},
Expand Down Expand Up @@ -48,8 +47,7 @@ export default class oAuth2ImplicitGrant {
login() {
return new Promise((resolve, reject) => {
const settings = this.settings;
const generatedNonce =
(settings.nonceFn && settings.nonceFn()) || this.generateNonce();
const generatedNonce = (settings.nonceFn && settings.nonceFn()) || this.generateNonce();
sessionStorage.setItem('luigi.nonceValue', generatedNonce);
if (!settings.oAuthData.nonce) {
settings.oAuthData.nonce = generatedNonce;
Expand All @@ -75,9 +73,7 @@ export default class oAuth2ImplicitGrant {
settings.oAuthData.redirect_uri = `${Helpers.prependOrigin(
settings.oAuthData.redirect_uri
)}?storageType=${Luigi.auth().store.getStorageType()}`;
settings.oAuthData.state = btoa(
encodeURI(window.location.href) + '_luigiNonce=' + generatedNonce
);
settings.oAuthData.state = btoa(encodeURI(window.location.href) + '_luigiNonce=' + generatedNonce);

for (const name in settings.oAuthData) {
const node = createInputElement(name, settings.oAuthData[name]);
Expand All @@ -100,13 +96,9 @@ export default class oAuth2ImplicitGrant {

logout(authData, authEventLogoutFn) {
const settings = this.settings;
const logouturl = `${settings.logoutUrl}?id_token_hint=${
authData.idToken
}&client_id=${
const logouturl = `${settings.logoutUrl}?id_token_hint=${authData.idToken}&client_id=${
settings.oAuthData.client_id
}&post_logout_redirect_uri=${Helpers.prependOrigin(
settings.post_logout_redirect_uri
)}`;
}&post_logout_redirect_uri=${Helpers.prependOrigin(settings.post_logout_redirect_uri)}`;
authEventLogoutFn && authEventLogoutFn();

setTimeout(() => {
Expand All @@ -122,43 +114,29 @@ export default class oAuth2ImplicitGrant {
return clearInterval(this.expirationCheckIntervalInstance);
}

const tokenExpirationDate =
(authData && authData.accessTokenExpirationDate) || 0;
const tokenExpirationDate = (authData && authData.accessTokenExpirationDate) || 0;
const currentDate = new Date();
if (tokenExpirationDate - currentDate < expirationCheckInterval) {
clearInterval(this.expirationCheckIntervalInstance);
Luigi.auth().store.removeAuthData();
// TODO: check if valid (mock-auth requires it), post_logout_redirect_uri is an assumption, might not be available for all auth providers
const redirectUrl = `${
this.settings.logoutUrl
}?error=tokenExpired&post_logout_redirect_uri=${Helpers.prependOrigin(
this.settings.post_logout_redirect_uri
)}`;
Luigi.auth().handleAuthEvent(
'onAuthExpired',
this.settings,
undefined,
redirectUrl
);
}?error=tokenExpired&post_logout_redirect_uri=${Helpers.prependOrigin(this.settings.post_logout_redirect_uri)}`;
Luigi.auth().handleAuthEvent('onAuthExpired', this.settings, undefined, redirectUrl);
}
}, expirationCheckInterval);
}

setTokenExpireSoonAction() {
const accessTokenExpiringNotificationTime =
this.settings.accessTokenExpiringNotificationTime * 1000;
const expirationCheckInterval =
this.settings.expirationCheckInterval * 1000;
const accessTokenExpiringNotificationTime = this.settings.accessTokenExpiringNotificationTime * 1000;
const expirationCheckInterval = this.settings.expirationCheckInterval * 1000;
let authData = this.getAuthData();
if (authData) {
this.expirationSoonCheckIntervalInstance = setInterval(() => {
const tokenExpirationDate =
(authData && authData.accessTokenExpirationDate) || 0;
const tokenExpirationDate = (authData && authData.accessTokenExpirationDate) || 0;
const currentDate = new Date();
if (
tokenExpirationDate - currentDate.getTime() <
accessTokenExpiringNotificationTime
) {
if (tokenExpirationDate - currentDate.getTime() < accessTokenExpiringNotificationTime) {
Luigi.auth().handleAuthEvent('onAuthExpireSoon', this.settings);
clearInterval(this.expirationSoonCheckIntervalInstance);
}
Expand All @@ -167,9 +145,8 @@ export default class oAuth2ImplicitGrant {
}

generateNonce() {
const validChars =
'0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz';
const crypto = window.crypto || window.msCrypto;
const validChars = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz';
const crypto = window.crypto;
const random = Array.from(crypto.getRandomValues(new Uint8Array(20)));

return random.map(x => validChars[x % validChars.length]).join('');
Expand Down
11 changes: 1 addition & 10 deletions plugins/auth/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ class HelpersClass {
* @private
*/
getRandomId() {
// window.msCrypto for IE 11
return (window.crypto || window.msCrypto).getRandomValues(
new Uint32Array(1)
)[0];
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}

isFunction(anyParam) {
Expand All @@ -21,12 +18,6 @@ class HelpersClass {
return anyParam && this.isFunction(anyParam.then);
}

isIE() {
const ua = navigator.userAgent;
/* MSIE used to detect old browsers and Trident used to newer ones*/
return Boolean(ua.includes('MSIE ') || ua.includes('Trident/'));
}

/**
* Simple object check.
* @param item mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Luigi Mock Identity Provider</title>
<link
Expand Down
1 change: 0 additions & 1 deletion test/e2e-js-test-application/public/auth/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="keywords" content="logout" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Luigi Mock Identity Provider</title>
<link rel="stylesheet" href="../../fundamental-styles/fundamental-styles.css" />
Expand Down
1 change: 0 additions & 1 deletion test/e2e-test-application/src/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Logout successful</title>
Expand Down
10 changes: 0 additions & 10 deletions website/docs/static/public/docsearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@
color: #aaa
}

.searchbox__input:-ms-input-placeholder {
color: #aaa
}

.searchbox__input::-ms-input-placeholder {
color: #aaa
}

.searchbox__input::placeholder {
color: #aaa
}
Expand All @@ -89,7 +81,6 @@
font-size: inherit;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
right: inherit;
left: 0
Expand Down Expand Up @@ -132,7 +123,6 @@
font-size: inherit;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
fill: rgba(0, 0, 0, .5)
}
Expand Down
Loading

0 comments on commit f30a186

Please sign in to comment.