Developer forum

Forum » CMS - Standard features » Redirect after Extranet login

Redirect after Extranet login

Michael Andersen
Reply

I have a website in three languages on three different domains. The site is built on the wrap.

At the moment when the user logs in they are automatically directed to the first language's login page. How do I change it so on my two secondary languages the users are redirected to pages on those languages?


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You simply submit the login form to the page you want them to go to... Add the ID to the action.

Votes for this answer: 2
 
Michael Fenech-Andersen
Reply

I'm using the modal login from the Wrapper and it already has the current page id showing. Below is from the form in Master.cshtml

                <form role="form" id="loginform" method="post">
                    <div class="modal-body">
                        @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk")))
                        {
                            <script>alert("@GetValue("DW_extranet_error_uk")");</script>
                        }

                        <input type="hidden" name="ID" value="@Pageview.ID" />
                        <input type="hidden" name="DWExtranetUsernameRemember" value="True" />
                        <input type="hidden" name="DWExtranetPasswordRemember" value="True" />

 

but there is still some redirection going on at a later stage and can't figure out where that happens. Is there a setting somewhere for "After login redirect to page..." or something similar?

 

 
Michael Andersen
Reply

I found my solution. In the backend Users > Group > Start page I had set the startpage to a logged in page in one of my languages.

I removed that setting and did as Nicolai suggested and set the ID according to language in my Master.cshtml:

                          @{
                                        string afterLoginGoTo = "";
                                        if (GetGlobalValue("Global:Area.Lang") == "de")
                                          {
                                          afterLoginGoTo = "10287";
                                          }
                                        else if (GetGlobalValue("Global:Area.Lang") == "da")
                                          {
                                          afterLoginGoTo = "10510";
                                          }
                                        else if (GetGlobalValue("Global:Area.Lang") == "en")
                                          {
                                          afterLoginGoTo = "10585";
                                          }                      
                      }

<form role="form" id="loginform" method="post" action="/Default.aspx?ID=@afterLoginGoTo">

Screen_Shot_2017-03-16_at_09.30.40.png

 

You must be logged in to post in the forum