Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- false || function() {
- $A.componentService.addComponentClass("markup://salesforceIdentity:loginForm", function() {
- return {
- meta: {
- name: "salesforceIdentity$loginForm",
- "extends": "markup://aura:component"
- },
- controller: {
- initialize: function(b, a, c) {
- $A.getEvt("markup://siteforce:registerQueryEventMap").setParams({
- qsToEvent: c.qsToEventMap
- }).fire();
- b.set("v.isUsernamePasswordEnabled", c.getIsUsernamePasswordEnabled(b, a, c));
- b.set("v.isSelfRegistrationEnabled", c.getIsSelfRegistrationEnabled(b, a, c));
- b.set("v.communityForgotPasswordUrl", c.getCommunityForgotPasswordUrl(b, a, c));
- b.set("v.communitySelfRegisterUrl", c.getCommunitySelfRegisterUrl(b, a, c)) //Sets the Community Self Registration URL for anchor Tag with value "Not a member?"
- },
- handleLogin: function(b, a, c) {
- c.handleLogin(b, a, c)
- },
- setStartUrl: function(b, a, c) {
- (a = a.getParam("startURL")) && b.set("v.startUrl", a)
- },
- onKeyUp: function(b, a, c) {
- 13 === a.getParam("keyCode") && c.handleLogin(b, a, c)
- },
- navigateToForgotPassword: function(b, a, c) {
- a = b.get("v.communityForgotPasswordUrl");
- $A.util.isUndefinedOrNull(a) && (a = b.get("v.forgotPasswordUrl"));
- b = {
- url: a
- };
- $A.getEvt("markup://force:navigateToURL").setParams(b).fire()
- },
- navigateToSelfRegister: function(b, a, c) {
- a = b.get("v.communitySelfRegisterUrl");
- null == a && (a = b.get("v.selfRegisterUrl"));
- b = {
- url: a
- };
- $A.getEvt("markup://force:navigateToURL").setParams(b).fire()
- }
- },
- helper: {
- qsToEventMap: {
- startURL: "e.salesforceIdentity:setStartUrl"
- },
- handleLogin: function(b, a, c) {
- a = b.find("username").get("v.value");
- c = b.find("password").get("v.value");
- var e = b.get("c.login")
- , d = b.get("v.startUrl");
- if (window.salesforceIdentity) {
- var f = window.salesforceIdentity.getStartUrl();
- f && (d = f)
- }
- d = decodeURIComponent(d);
- e.setParams({
- username: a,
- password: c,
- startUrl: d
- });
- e.setCallback(this, function(a) {
- a = a.getReturnValue();
- null !== a && (b.set("v.errorMessage", a),
- b.set("v.showError", !0))
- });
- $A.enqueueAction(e)
- },
- getIsUsernamePasswordEnabled: function(b, a, c) {
- a = b.get("c.getIsUsernamePasswordEnabled");
- a.setCallback(this, function(a) {
- a = a.getReturnValue();
- null !== a && b.set("v.isUsernamePasswordEnabled", a)
- });
- $A.enqueueAction(a)
- },
- getIsSelfRegistrationEnabled: function(b, a, c) {
- a = b.get("c.getIsSelfRegistrationEnabled");
- a.setCallback(this, function(a) {
- a = a.getReturnValue();
- null !== a && b.set("v.isSelfRegistrationEnabled", a)
- });
- $A.enqueueAction(a)
- },
- getCommunityForgotPasswordUrl: function(b, a, c) {
- a = b.get("c.getForgotPasswordUrl");
- a.setCallback(this, function(a) {
- a = a.getReturnValue();
- null !== a && b.set("v.communityForgotPasswordUrl", a)
- });
- $A.enqueueAction(a)
- },
- //Function to call the server-side controller function. getSelfRegistrationUrl
- getCommunitySelfRegisterUrl: function(b, a, c) {
- a = b.get("c.getSelfRegistrationUrl");
- a.setCallback(this, function(a) {
- a = a.getReturnValue();
- null !== a && b.set("v.communitySelfRegisterUrl", a)
- });
- $A.enqueueAction(a)
- }
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement