Developer forum

Forum » CMS - Standard features » How to setup login functionality in frontend?

How to setup login functionality in frontend?

Henrik Sørensen
Reply

I am new to Dynamicweb and have to set up a solution with login in frontend. Unfortunately, I have not been able to find any documentation on regular login functionality whatsoever.

I have found various login-related documents in the backend, e.g. Files\Templates\UserManagement\Login.html. Here the action attribute of the form points to a non-existing "Default.aspx", though.

Do I really have to setup my own code, inspecting user table/tables in the database?

Furthermore, I need to redirect users to a page with another layout after login.

Simple enough to code, but I would like to use built-in Dynamicweb functionality, as I have a feeling it is quite straightforward.

Thanks in advance

 

 

 


Replies

 
Thomas Schroll
Reply
This post has been marked as an answer

Hi Henrik

In the page proporties under Advanced/Permissions you can select which users have access to the current page. There you will also find which template is handling the login.

Regarding redirecting to another page, I think you set the 'Start page' in user management if you need custom pages or you can change the Id in your login form.

Regards Thomas

Votes for this answer: 1
 
Henrik Sørensen
Reply

I got it!

All you need to activate the login functionality is to submit a form with two inputs-fields, named "username" and "password"! (This simple information was very difficult to find)

I thought the form's action attribute pointed to the page handling the security-check, but it simply points to the page the should be loaded next.

I my case it shoul be the same page, so I entered this:

<form action="<!--@Global:Pageview.Url-->">

 

In my case I can do without the templates, and also the permission settings on the page/paragraph: I will let the users log in if they please, and then block out restricted material by 

    @{        
        if(Pageview.User.UserID >0)
            {
            <span>You are LOGGED IN. Here is some secret stuff: .....   </span>
            }

       }

 

I still need to find a way to handle a certain page: The logged-in and the pre-log-in version have different layouts, so I need to redirect one of them.. 

Thank you Thomas for leading me in the right direction!

 

 

You must be logged in to post in the forum