Skip to content

Commit

Permalink
Added unity flow
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Dec 8, 2016
1 parent a46f9f4 commit 179758a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"zuul-ngrok": "gnandretta/zuul-ngrok#upgrade-ngrok"
},
"dependencies": {
"auth0-js": "v8.0.0-alpha.2",
"auth0-js": "git://github.com/auth0/auth0.js.git#realm-grant",
"blueimp-md5": "2.3.1",
"fbjs": "^0.3.1",
"immutable": "^3.7.3",
Expand Down
5 changes: 5 additions & 0 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function setup(id, clientID, domain, options, hookRunner, emitEventFn) {
emitEventFn: emitEventFn,
hookRunner: hookRunner,
useTenantInfo: options.__useTenantInfo || false,
legacyMode: options.legacyMode === false ? false : true,
hashCleanup: options.hashCleanup === false ? false : true,
allowedConnections: Immutable.fromJS(options.allowedConnections || []),
ui: extractUIOptions(id, options)
Expand Down Expand Up @@ -477,6 +478,10 @@ export function hashCleanup(m) {
return get(m, "hashCleanup");
}

export function legacyMode(m) {
return get(m, "legacyMode");
}

export function emitHashParsedEvent(m, parsedHash) {
emitEvent(m, "hash_parsed", parsedHash);
}
Expand Down
6 changes: 5 additions & 1 deletion src/core/web_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Auth0WebAPI {
redirectUri: opts.redirectUrl,
responseMode: opts.responseMode,
responseType: opts.responseType,
legacyMode: opts.legacyMode === false ? false : true,
_sendTelemetry: opts._sendTelemetry === false ? false : true,
_telemetryInfo: opts._telemetryInfo || default_telemetry
});
Expand All @@ -39,7 +40,10 @@ class Auth0WebAPI {
const f = loginCallback(!authOpts.popup, cb);
const client = this.clients[lockID];

if (authOpts.popup) {
if (!this.authOpts[lockID].legacyMode) {
options.realm = options.connection;
client.client.loginRealm({...options, ...authOpts, ...authParams}, f);
} else if (authOpts.popup) {
client.popup.login({...options, ...authOpts, ...authParams}, f)
} else {
client.redirect.login({...options, ...authOpts, ...authParams}, f);
Expand Down
1 change: 1 addition & 0 deletions support/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
const domain = "auth0-tests-lock.auth0.com";
const options = {
rememberLastLogin: true,
legacyMode: false,
auth: {
redirect: false
}
Expand Down

0 comments on commit 179758a

Please sign in to comment.