Created
July 15, 2020 05:20
-
-
Save hisashiyamaguchi/b219d49f5c8d329571c3094bdf9de484 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Travel0 Login</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<link rel="stylesheet" href="https://d2qcgv1x1k2it7.cloudfront.net/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://d2qcgv1x1k2it7.cloudfront.net/css/v2/lock-normal-overrides.css"> | |
</head> | |
<body> | |
<nav class="main-header navbar navbar-expand-md navbar-dark bg-primary fixed-top"> | |
<div class="container"><a href="/" class="navbar-brand mx-auto">Travel0</a></div> | |
</nav> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js" crossorigin="anonymous"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js" crossorigin="anonymous"></script> | |
<script src="https://cdn.auth0.com/js/lock/11.11/lock.min.js"></script> | |
<script> | |
// Decode utf8 characters properly | |
var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@')))); | |
config.extraParams = config.extraParams || {}; | |
var connection = config.connection; | |
var prompt = config.prompt || config.extraParams.prompt; | |
var languageDictionary = { | |
title: 'Log In' | |
}; | |
var language; | |
if (typeof config.dict === 'string') { | |
language = config.dict; | |
} | |
var loginHint = config.extraParams.login_hint; | |
var logo = 'https://d2qcgv1x1k2it7.cloudfront.net/icons/logo/travel0-green.svg' | |
if (config.callbackURL.includes('.hooli.corporate.')) { | |
logo = 'https://d2qcgv1x1k2it7.cloudfront.net/icons/icon-hooli-logo.png' | |
} | |
var lock = new Auth0Lock(config.clientID, config.auth0Domain, { | |
configurationBaseUrl: config.clientConfigurationBaseUrl, | |
overrides: { | |
__tenant: config.auth0Tenant, | |
__token_issuer: document.origin | |
}, | |
auth: { | |
redirectUrl: config.callbackURL, | |
responseType: (config.internalOptions || {}).response_type || | |
(config.callbackOnLocationHash ? 'token' : 'code'), | |
params: config.internalOptions | |
}, | |
assetsUrl: config.assetsUrl, | |
allowedConnections: connection ? [connection] : null, | |
rememberLastLogin: !prompt, | |
language: language, | |
languageDictionary: languageDictionary, | |
theme: { | |
logo: logo, | |
primaryColor: '#03C07B' | |
}, | |
//container: "widget", | |
prefill: loginHint ? { email: loginHint, username: loginHint } : null, | |
closable: false, | |
initialScreen: prompt === "signup" ? "signUp" : "login", | |
avatar: null, | |
defaultADUsernameFromEmailPrefix: false, | |
// uncomment if you want small buttons for social providers | |
// socialButtonStyle: 'small' | |
}); | |
lock.show({ | |
// allowedConnections: ['google-oauth2'], | |
}); | |
var validEvents = [ | |
'unrecoverable_error', | |
'authenticated', | |
'authorization_error', | |
'signin ready', | |
'signup ready', | |
'forgot_password ready', | |
'socialOrPhoneNumber ready', | |
'socialOrEmail ready', | |
'vcode ready', | |
'forgot_password submit', | |
'signin submit', | |
'signup submit', | |
'socialOrPhoneNumber submit', | |
'socialOrEmail submit', | |
'vcode submit', | |
'federated login' | |
]; | |
validEvents.forEach(function (e) { | |
lock.on(e, function (args) { | |
mixpanel && mixpanel.track(`Auth0 Lock: ${e}`, args); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment