1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Logging in

Logging in

2 posts, 0 answered
  1. Julia Shah
    Julia Shah avatar
    13 posts
    Registered:
    03 Sep 2012
    17 Jul 2007
    Link to this post
    Hi,

    I have created "clients" role. When a user associated with that role logs in to the website, I want to show him a certain page. But instead the user is taken to the administration dashboard. What am I doing wrong?

    Thanks,
    Julia
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    18 Jul 2007
    Link to this post
    Hello Julia Shah,

    To redirect users according to the role they are in, you should make a little modification to the login page located under the Sitefinity folder. A code change for the Login1_Authenticate method similar to the one below should do the work:

    void Login1_Authenticate(object sender, AuthenticateEventArgs e)  
    {  
        e.Authenticated = UserManager.Default.ValidateUser(this.Login1.UserName, this.Login1.Password);  
        if (UserManager.Default.IsUserInRole(this.Login1.UserName, "testers"))  
            this.Login1.DestinationPageUrl = "Admin/Modules.aspx";  

    Here "testers" is a specific role for which it should redirect the user to the modules page.

    Best wishes,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered