Customizing front-end login/logout redirects I have "manage" link that redirects to domain.com/login.
"login" is custom front-end page that after logging in redirects to homepage.
After logging in when I click "manage" again the domain.com/login redirects me to CP dashboard.
Signing out from CP redirects me to default Craft login page.





How to redirect directly to dashboard after logging in?
How to redirect directly to domain.com/login or homepage after signing out?


I'm also using manager as cpTrigger, and this is my config:

'postLoginRedirect' =&gt; 'manager',
'logoutPath' =&gt; 'login',
'cpTrigger' =&gt; 'manager',


For some reason according to #1 postLoginRedirect doesn't take effect
same for #2 and logoutPath, maybe I'm using them in the wrong way?

login/index.html code:

{% extends "login/_layout" %}
{% set title = "Welcome back, friend :)" %}
{% block content %}
          &lt;div class="box"&gt;

          &lt;form method="post" accept-charset="UTF-8"&gt;
          {{ getCsrfInput() }}
          &lt;input type="hidden" name="action" value="users/login"&gt;

            {% if errorMessage is defined %}
             &lt;article class="message is-danger"&gt;
              &lt;div class="message-body"&gt;   
               {{ errorMessage }}
              &lt;/div&gt;
             &lt;/article&gt;
            {% endif %}

            &lt;div class="field"&gt;
              &lt;p class="control has-icon"&gt;
                &lt;input class="input" id="loginName" type="text" name="loginName" placeholder="Email"&gt;
                &lt;span class="icon"&gt;
                &lt;i class="fa fa-envelope"&gt;&lt;/i&gt;
                &lt;/span&gt;
              &lt;/p&gt;
            &lt;/div&gt;

              &lt;div class="field"&gt;
              &lt;p class="control has-icon"&gt;
                &lt;input class="input" id="password" type="password" name="password" placeholder="Password"&gt;
                &lt;span class="icon"&gt;
                &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
                &lt;/span&gt;
              &lt;/p&gt;
            &lt;/div&gt;

              &lt;div class="field"&gt;
              &lt;p class="control"&gt;
              &lt;label class="checkbox"&gt;
                &lt;input type="checkbox" name="rememberMe" value="1"&gt;
                Keep me logged in
              &lt;/label&gt;
              &lt;/p&gt;
            &lt;/div&gt;

              &lt;hr&gt;

              &lt;p class="control"&gt;
                &lt;button class="button is-primary" type="submit"&gt;Login&lt;/button&gt;
                &lt;a class="button is-default" href="{{ siteUrl }}"&gt;Cancel&lt;/a&gt;

              &lt;/p&gt;
          &lt;/form&gt;
          &lt;/div&gt;
            &lt;p class="has-text-centered"&gt;
              &lt;a href="{{ url('login/register') }}"&gt;Register an Account&lt;/a&gt;
              | 
              &lt;a href="{{ url('login/forgotpassword') }}"&gt;Forgot password&lt;/a&gt;
              | 
              &lt;a href="{{ url('contact') }}"&gt;Need help?&lt;/a&gt;
            &lt;/p&gt;
{% endblock %}
How to redirect directly to dashboard after logging in?
  


Since your login form is on the front-end of the site, the postLoginRedirect should do what you're looking for.

You can see the logic Craft uses to determine where to send a user after a successful login here: https://github.com/craftcms/cms/tree/master-v2/src/controllers/UsersController.php#L1599-L1614


  How to redirect directly to domain.com/login or homepage after signing out?


You've got the logoutPath config setting set 'login', which is going to log a user out as soon as they hit the /login URI, which probably isn't what you're looking for.

There currently isn't a config setting to decide where to send a user after they've been logged out, but you could write a very simple plugin that listened to the onLogout event and redirected to wherever you wished.