3

I have created a login component in LWC and added it in a Standard Page in lightning community. But I am unable to refer that login page from the login page type on the Login & Registration (L&R) page of the Administration workspace.

Login & Registration -> Login Page Type (Community Builder Page) -> unable to see my custom login page.

Am I missing something?

enter image description here

6
  • Didyou give guest user access to the login page you created?
    – javanoob
    Dec 23 '19 at 5:49
  • Yes Page Access set as Public
    – Avijit
    Dec 23 '19 at 9:51
  • @Avijit on which standard page did you add the LWC component ?
    – Shamina
    Dec 23 '19 at 10:29
  • I am creating from community builder Pages->new page->standard page
    – Avijit
    Dec 23 '19 at 10:39
  • Each community has site auto created. Is the login page added to the site? @Avijit
    – javanoob
    Dec 24 '19 at 4:51
3

You have to change Meta file of the component to use in Lightning Community.

You Have to set the target for that.

Here is the example

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
    <apiVersion>45.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>Hello World</masterLabel>
    <targets>
        <target>lightningCommunity__Page</target>
        <target>lightningCommunity__Default</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightningCommunity__Default">
            <property name="string" type="String" default="jsMetaValue"></property>
            <property name="boolean" type="Boolean" default="true"></property>
            <property name="integer" type="Integer" default="5"></property>
            <property name="picklist" type="String" default="value3" datasource="value1,value2,value3" />
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
3
  • All are set as required, but I am not able to see lightning page under Login & Registration -> Login Page Type (Community Builder Page)
    – Avijit
    Dec 23 '19 at 10:08
  • Did you get this solved? I am also facing this issue need you help. @Avijit
    – karan
    Sep 21 '20 at 21:03
  • @karan - Unfortunately no.
    – Avijit
    Oct 6 '20 at 19:04
0

If you are trying to customize the login experience, then it seems that you need to customize the standard Login community page itself.

So try to add your custom LWC component on that std login page and under Administration settings, select login page type as Community Builder page and choose login .

Do read documentation here about customizing apex logic for custom login behaviour.

From community builder, remember to publish your changes before testing the login.

3
  • Yes I get this, we cannot use ShowToastEvent lightning/platformShowToastEvent in login page that is why I was creating new Community Builder page. But the challenge is I am not able to select new page from page selection.
    – Avijit
    Dec 23 '19 at 13:01
  • @Avijit as per component reference lightning/platformShowToastEvent is available in lightning experience, it is not indicated as being supported in communities. so not sure you can use this in community pages
    – Shamina
    Dec 24 '19 at 7:25
  • ShowToastEvent is supported if we create lightning community page, I have tested.
    – Avijit
    Dec 24 '19 at 9:07
0

This doesn't directly answer your question but this is another way of configuring a custom login page.

Create a page variation of the standard Login Page as shown below. I gave the new page variation as CustomLoginPage and marked it as Default.

enter image description here

Now, you can edit the page and add/remove components from this page. You can even change page structure to 2 column layout and etc.

Here you can see that I removed the company logo and Already employee section and you can even drop your custom built components here.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.