Skip to content

Commit

Permalink
is not implemented #713
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Dec 19, 2016
1 parent 9592479 commit f8f0109
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/connection/enterprise.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ export function isHRDDomain(m, email) {

export function toggleHRD(m, email) {
if (email) {
m = setUsername(m, emailLocalPart(email), "username", false);
const username = l.defaultADUsernameFromEmailPrefix(m) ? emailLocalPart(email) : email;
m = setUsername(m, username, "username", false);
m = tset(m, "hrdEmail", email);
} else {
m = tremove(m, "hrdEmail");
Expand Down
7 changes: 6 additions & 1 deletion src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export function setup(id, clientID, domain, options, hookRunner, emitEventFn) {
useTenantInfo: options.__useTenantInfo || false,
hashCleanup: options.hashCleanup === false ? false : true,
allowedConnections: Immutable.fromJS(options.allowedConnections || []),
ui: extractUIOptions(id, options)
ui: extractUIOptions(id, options),
defaultADUsernameFromEmailPrefix: !!options.defaultADUsernameFromEmailPrefix
}));

m = i18n.initI18n(m);
Expand Down Expand Up @@ -319,6 +320,10 @@ export function loggedIn(m) {
return tget(m, "loggedIn", false);
}

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

export function warn(x, str) {
const shouldOutput = Map.isMap(x)
? !ui.disableWarnings(x)
Expand Down

0 comments on commit f8f0109

Please sign in to comment.