CINXE.COM

Sign In with MNG

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Sign In with MNG</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" /> </head> <body> <!--[if IE 8]> <script src="//cdnjs.cloudflare.com/ajax/libs/ie8/0.2.5/ie8.js"></script> <![endif]--> <!--[if lte IE 9]> <script src="https://cdn.auth0.com/js/base64.js"></script> <script src="https://cdn.auth0.com/js/es5-shim.min.js"></script> <![endif]--> <link rel="stylesheet" href="https://ui-static-assets-prod.mng-digisubs-prod.com/css/auth0.css" /> <script src="https://ui-static-assets-prod.mng-digisubs-prod.com/js/auth0Manager.js"></script> <script src="https://cdn.auth0.com/js/lock/11.25/lock.min.js"></script> <script src="https://unpkg.com/axios/dist/axios.min.js"></script> <script> //set defaultAsset obj so lock will still show if the assetManager.js file fails to load var defaultAsset = { logo: "https://prodmg2.blob.core.windows.net/auth0-assets/mng/img/MNG_Logo.png", title: "Media News Group", primaryColor: "#107E8E", authButtons: { "Trib-Google": { displayName: "Google", primaryColor: "white", foregroundColor: "black", icon: "https://ui-static-assets-prod.s3.us-west-1.amazonaws.com/img/google-icon.svg" }, "Trib-Apple": { displayName: "Apple", primaryColor: "#000", foregroundColor: "white", icon: "https://upload.wikimedia.org/wikipedia/commons/3/31/Apple_logo_white.svg" }, "Trib-Facebook": { displayName: "Facebook", primaryColor: "#3b5998", foregroundColor: "white", icon: "https://upload.wikimedia.org/wikipedia/commons/4/4d/F_icon_reversed.svg" } }, languageDictionary: { title: '', signUpTitle: '', signUpTerms: 'By checking this box and creating an account, I affirm that I am 18 years of age or older. I understand that the information I provide willingly may be used to support my subscription, to offer additional products and services tied specifically to my subscription, and that this information may be shared with a trusted third party.I have read and accept the <a href="https://www.medianewsgroup.com/terms-of-use/">Terms of Service</a> and acknowledge the <a href="https://www.medianewsgroup.com/privacy-policy/">Privacy Policy</a> as stated in the links.' }, showTerms: true, mustAcceptTerms: true, closable: false }; var allMNGConnections = [ 'Username-Password-Authentication', 'apple', 'facebook', 'google-oauth2' ]; var allTribConnections = [ 'Trib-Passthrough', 'Trib-Main', 'Trib-Apple', 'Trib-Facebook', 'Trib-Google' ]; // Decode utf8 characters properly var config = JSON.parse(decodeURIComponent(escape(window.atob('eyJhc3NldHNVcmwiOiIiLCJhdXRoMERvbWFpbiI6ImxvZ2luLm5wdXNlcmxvZ2luLmNvbSIsImF1dGgwVGVuYW50IjoibW5nLXByb2QiLCJjbGllbnRDb25maWd1cmF0aW9uQmFzZVVybCI6Imh0dHBzOi8vbG9naW4ubnB1c2VybG9naW4uY29tLyIsImNhbGxiYWNrT25Mb2NhdGlvbkhhc2giOmZhbHNlLCJjYWxsYmFja1VSTCI6Imh0dHBzOi8vYWN0aXZhdGUuZGFpbHlmcmVlbWFuLmNvbS9nYXRld2F5L2dlbmVyaWMuYXNweD9wYmlkPTk5ODgzZmY3LThlYzMtNDQyZS04MWFjLWI4NTc0YjhlNjk2YiIsImNkbiI6Imh0dHBzOi8vY2RuLmF1dGgwLmNvbS8iLCJjbGllbnRJRCI6IlpCeGcyWXlzN2NzUEM3WkJwcUhHZ1d4TTdwOG9mRmRWIiwiZGljdCI6eyJzaWduaW4iOnsidGl0bGUiOiJLaW5nc3RvbiBEYWlseSBGcmVlbWFuIn19LCJleHRyYVBhcmFtcyI6eyJwcm90b2NvbCI6Im9hdXRoMiIsInJlc3BvbnNlX21vZGUiOiJmb3JtX3Bvc3QiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIiwibm9uY2UiOiI4ZWQ4NjlhMy0zNzQyLTQ2YjktYmY0Yy0yOTM0YWY0MzJiOGEiLCJ0ZW5hbnQiOiJtbmctcHJvZCIsInR5cGUiOiJpZF90b2tlbiB0b2tlbiIsImNsaWVudElEIjoiWkJ4ZzJZeXM3Y3NQQzdaQnBxSEdnV3hNN3A4b2ZGZFYiLCJyZWRpcmVjdFVSSSI6Imh0d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GsxYmtsRGRrTnNORlUzZUZZMmNtNXZMV3BPTjZGdXBXeHZaMmx1bzNScFpOa2dTbGczUjJRdGEwOXFVWHBCT1dSalJVeGtVRFowVlVsRWFVNTFkMFZNWjJHalkybGsyU0JhUW5obk1sbDVjemRqYzFCRE4xcENjSEZJUjJkWGVFMDNjRGh2Wmtaa1ZnIn0sIndpZGdldFVybCI6Imh0dHBzOi8vY2RuLmF1dGgwLmNvbS93Mi9hdXRoMC13aWRnZXQtNS4yLm1pbi5qcyIsImlzVGhpcmRQYXJ0eUNsaWVudCI6ZmFsc2UsImF1dGhvcml6YXRpb25TZXJ2ZXIiOnsidXJsIjoiaHR0cHM6Ly9sb2dpbi5ucHVzZXJsb2dpbi5jb20iLCJpc3N1ZXIiOiJodHRwczovL2xvZ2luLm5wdXNlcmxvZ2luLmNvbS8ifSwiY29sb3JzIjp7fX0=')))); //console.log(config); if (config.dict && config.dict.signin && config.dict.signin.title) { //languageDictionary = { title: config.dict.signin.title }; languageDictionary = { title: '', signUpTitle: '', signUpTerms: 'By checking this box and creating an account, I affirm that I am 18 years of age or older. I understand that the information I provide willingly may be used to support my subscription, to offer additional products and services tied specifically to my subscription, and that this information may be shared with a trusted third party.I have read and accept the <a href="https://www.medianewsgroup.com/terms-of-use/">Terms of Service</a> and acknowledge the <a href="https://www.medianewsgroup.com/privacy-policy/">Privacy Policy</a> as stated in the links.' }; } else if (typeof config.dict === 'string') { language = config.dict; } //check if we loaded the Auth0AssetManager. if(typeof Auth0SettingsManager == 'undefined'){ console.log("NO Auth0SettingsManager"); var auth0Settings = defaultAsset; }else{ console.log("has Auth0SettingsManager"); var auth0Settings = Auth0SettingsManager.init(config.callbackURL); console.log("auth0Settings", auth0Settings); } config.extraParams = config.extraParams || {}; var allowedConnections; if (config.connection) { allowedConnections = [config.connection]; } else if (config.extraParams.silo == 'mng') { allowedConnections = allMNGConnections; } else if (config.extraParams.silo == 'trib') { allowedConnections = allTribConnections; } else { allowedConnections = allMNGConnections.concat(allTribConnections); } var prompt = config.prompt; var languageDictionary; var language; var loginHint = config.extraParams.login_hint; var colors = config.colors || {}; var initialScreen = config.extraParams.initialScreen; let allowLogin = true; // Available Lock configuration options: https://auth0.com/docs/libraries/lock/v11/configuration if(config.extraParams && config.extraParams.ampRegiWall == 'true'){ allowLogin = false; } var lock = new Auth0Lock(config.clientID, config.auth0Domain, { initialScreen: initialScreen, allowLogin: allowLogin, auth: { redirectUrl: config.callbackURL, responseType: (config.internalOptions || {}).response_type || (config.callbackOnLocationHash ? 'token' : 'code'), params: config.internalOptions }, configurationBaseUrl: config.clientConfigurationBaseUrl, overrides: { __tenant: config.auth0Tenant, __token_issuer: config.authorizationServer.issuer }, assetsUrl: config.assetsUrl, allowedConnections: allowedConnections, rememberLastLogin: !prompt, language: language, languageDictionary: auth0Settings.languageDictionary, showTerms: auth0Settings.showTerms, mustAcceptTerms: auth0Settings.mustAcceptTerms, allowShowPassword: true, theme: { logo: auth0Settings.logo, primaryColor: auth0Settings.primaryColor, authButtons: { "Trib-Google": { displayName: "Google", primaryColor: "white", foregroundColor: "black", icon: "https://ui-static-assets-prod.s3.us-west-1.amazonaws.com/img/google-icon.svg" }, "Trib-Apple": { displayName: "Apple", primaryColor: "#000", foregroundColor: "white", icon: "https://upload.wikimedia.org/wikipedia/commons/3/31/Apple_logo_white.svg" }, "Trib-Facebook": { displayName: "Facebook", primaryColor: "#3b5998", foregroundColor: "white", icon: "https://upload.wikimedia.org/wikipedia/commons/4/4d/F_icon_reversed.svg" } } }, prefill: null, closable: auth0Settings.closable, defaultADUsernameFromEmailPrefix: false, forgotPasswordLink: setPassResetSource(new URL(config.callbackURL).origin, config.clientID) }); var lockPasswordless; function configurePasswordless(email){ if(lockPasswordless) return lockPasswordless; lockPasswordless = new Auth0LockPasswordless(config.clientID, config.auth0Domain, { auth: { redirectUrl: config.callbackURL, responseType: (config.internalOptions || {}).response_type || (config.callbackOnLocationHash ? 'token' : 'code'), params: {state: 'pswdls'} }, allowedConnections: ['email'], passwordlessMethod: 'link', configurationBaseUrl: config.clientConfigurationBaseUrl, // overrides: { // __tenant: config.auth0Tenant, // __token_issuer: config.authorizationServer.issuer // }, prefill: { email: email, username: email }, assetsUrl: config.assetsUrl, rememberLastLogin: !prompt, language: language, languageBaseUrl: config.languageBaseUrl, languageDictionary: languageDictionary, theme: { logo: auth0Settings.logo, primaryColor: auth0Settings.primaryColor, }, closable: false }); return lockPasswordless; } function initialDisplay(){ let button; if(document.getElementById('email-submit')){ button = document.getElementById('email-submit') button.style.display = "block"; } else{ const div = document.createElement("div"); div.className = "auth0-lock-widget"; button = document.createElement("button"); // Create a <li> node button.id = "email-submit"; button.style.cssText = ` width: 288px; background-color: ${auth0Settings.primaryColor}; color: #fff; border: 0; padding: 14px; display: block; box-sizing: border-box; width: 100%; overflow: hidden; border-radius: 0 0 5px 5px; transition: 0.2s ease-in-out; color: #fff; letter-spacing: 1px; font-size: 14px; text-transform: uppercase; ` const textnode = document.createTextNode("Next"); // Create a text node button.appendChild(textnode); // Append the text to <li> div.appendChild(button); const masterDiv = document.getElementById('auth0-lock-container-1').querySelector( '.auth0-lock-center' ); masterDiv.appendChild(div); button.addEventListener('click', function(){ userSubmit(); }); } document.querySelector('button.auth0-lock-submit').style.display = "none"; document.querySelector('div.auth0-lock-input-show-password').style.display = "none"; if(document.querySelector('p.auth0-lock-alternative')) document.querySelector('p.auth0-lock-alternative').style.display = "none"; //disable passwordless UI when user clicks Sign Up, restore when Login is clicked function signupHandler(){ document.querySelector('ul.auth0-lock-tabs').addEventListener('click', function (e){ if(e.target.innerText === "Sign Up"){ restoreLockModalToDefault(); } else{ const loginButtonLoaded = setInterval( () => { if ( document.querySelector('.auth0-lock-input-show-password') !== null ) { clearInterval( loginButtonLoaded ); initialDisplay(); } }, 100 ); // check every 100ms } const reAddEventListener = setInterval( () => { if ( document.querySelector('ul.auth0-lock-tabs') ) { signupHandler(); clearInterval(reAddEventListener) } }, 100 ); // check every 100ms }); } signupHandler(); // allow user to press enter key to submit their email document.onkeypress = keyPress; function keyPress(e){ var x = e || window.event; var key = (x.keyCode || x.which); if(key == 13){ userSubmit(); } } } function setPassResetSource(origin, clientId){ // exclude town news clients because they don't have reset pass pages const excludeArray = [ "kvI7O7QjfyQF92AdOl0an0LLznFau00s", ]; if(excludeArray.includes(clientId) || (!origin.includes("www") && !origin.includes("preprod") && !origin.includes("myaccount.") && !origin.includes("checkout.") && !origin.includes("enewspaper.")) ) { return null; } return origin.replace('myaccount.','').replace('checkout.','').replace('enewspaper.') + "/reset-password/?client=" + clientId; } lock.show(); //using domain referrer to decide if passwordless should be used let referrerUrl = new URL(document.referrer) let passwordless = false; domainCheck = referrerUrl.hostname.replace('https://','').replace('www.','').replace('develop.','').replace('preprod.','').replace('.com','').replace('login',''); console.log('domainCheck '+ domainCheck); if (domainCheck === 'twincities') { passwordless = true; // we need to wait for the login button to load to then manipulate the styling const loginButtonLoaded = setInterval( () => { if ( document.querySelector('.auth0-lock-input-show-password') !== null && document.getElementById('1-email') && document.querySelector('.auth0-lock-submit').style.cssText.includes('display: block') ) { clearInterval( loginButtonLoaded ); initialDisplay(); } }, 100 ); // check every 100ms } else { userSubmit(); } closeButton = document.getElementById("undefined-close-button"); closeButton.addEventListener("click", function () { returnPreviousPage(); }); function getUserEmailFromInput(){ return document.getElementById('1-email').value; } function userSubmit() { //check the users connection and serve up the correct lock modal const getUserConnection = new Promise((resolve, reject) => { if (!passwordless) { resolve(["regular_flow"]); return; } const getUsers = async () => { // Send a GET request with the authorization header set to // the string 'my secret token' const userEmail = getUserEmailFromInput(); console.log('checking this users connection : ', userEmail); document.body.style.cursor='wait'; const axiosConfig = { method: "post", url: "https://ya61e43yz0.execute-api.us-west-1.amazonaws.com/production/auth0/getDefaultUserConnection", headers: { "x-api-key": "DHL8Vs1UNo9u0WO52dVBzSuLi4kw2so25cXK1fy7" }, data: { "email": userEmail } }; axios(axiosConfig) .then(function (response) { if (response.data && response.data.connection === 'Username-Password-Authentication'){ resolve(['Username-Password-Authentication']); } else { resolve(['email']); } }) .catch(function (error) { console.error(error); reject('ManagmentAPI failed'); }).finally(() => { document.body.style.cursor='default'; }); } getUsers(); }); getUserConnection.then((response) => { if (initialScreen === 'signUp') { if(passwordless) restoreLockModalToDefault(); lock.show( { initialScreen } ); }else { if (response[0] === 'email') { lock.hide(); showPasswordlessModal(getUserEmailFromInput()); } else { if(passwordless) restoreLockModalToDefault(); } } }).catch(error => { console.error(error); if(passwordless)restoreLockModalToDefault(); }) } function showPasswordlessModal(email){ let lockPasswordless = configurePasswordless(email); lockPasswordless.show(); // we need to wait for the login button to load to then manipulate the styling const waitForEmailHeadingToChangeText = setInterval( () => { if ( document.getElementById('auth0-lock-container-2').querySelector('.auth0-lock-form').querySelector('span') ) { clearInterval( waitForEmailHeadingToChangeText ); let submitText = "Click “submit” to get a magic link sent to the email below, then click on the link to continue reading."; const passwordlessDiv = document.getElementById('auth0-lock-container-2'); passwordlessDiv.querySelector('.auth0-lock-form').querySelector('span').textContent = submitText; } }, 100 ); // check every 100ms } function restoreLockModalToDefault(){ document.querySelector('button.auth0-lock-submit').style.display = "block"; document.querySelector('div.auth0-lock-input-show-password').style.display = "block"; document.querySelector('p.auth0-lock-alternative').style.display = "block"; document.getElementById('email-submit').style.display = "none"; } function returnPreviousPage() { let previousURL = new URL(config.callbackURL); let params = previousURL.searchParams; window.location.assign(params.get("auth_redirect")); } </script> <style> .auth0-lock.auth0-lock .auth0-lock-social-button[data-provider^=oauth2].auth0-lock-social-big-button:first-child { border: 1px solid #dee0e2; } @media only screen and (max-width: 480px) { #email-submit { position: absolute; bottom: 0px; } .auth0-lock-widget { position: relative !important; } form.auth0-lock-widget { height: 500px !important; } } </style> </body> </html>