Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created January 23, 2015 10:43
Show Gist options
  • Save sandrinodimattia/5a8dedee87059a687ccd to your computer and use it in GitHub Desktop.
Save sandrinodimattia/5a8dedee87059a687ccd to your computer and use it in GitHub Desktop.
Go to strategy if only one is available
<!DOCTYPE html>
<html>
<head>
...
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
<script src="//cdn.auth0.com/js/lock-6.10.min.js"></script>
<script>
...
var lock = new Auth0Lock('@@clientID@@', '@@auth0Domain@@', initializationOptions);
lock.once('ready', function () {
var strategies = $('#a0-lock .a0-notloggedin .a0-iconlist [data-strategy]');
if (strategies && strategies.length === 1)
strategies.click();
});
...
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment