Answers.Body: <blockquote>
    <ol>
    <li>How to redirect directly to dashboard after logging in?</li>
    </ol>
  </blockquote>
  
  <p>Since your login form is on the front-end of the site, the <a href="https://craftcms.com/docs/config-settings#postLoginRedirect" rel="nofollow noreferrer">postLoginRedirect</a> should do what you're looking for.</p>
  
  <p>You can see the logic Craft uses to determine where to send a user after a successful login here: <a href="https://github.com/craftcms/cms/tree/master-v2/src/controllers/UsersController.php#L1599-L1614" rel="nofollow noreferrer">https://github.com/craftcms/cms/tree/master-v2/src/controllers/UsersController.php#L1599-L1614</a></p>
  
  <blockquote>
    <p>How to redirect directly to domain.com/login or homepage after signing out?</p>
  </blockquote>
  
  <p>You've got the <a href="https://craftcms.com/docs/config-settings#logoutPath" rel="nofollow noreferrer">logoutPath</a> config setting set <code>'login'</code>, which is going to log a user out as soon as they hit the <code>/login</code> URI, which probably isn't what you're looking for.</p>
  
  <p>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 <a href="https://pluginfactory.io" rel="nofollow noreferrer">plugin</a> that listened to the <a href="https://craftcms.com/docs/plugins/events-reference#userSession-onLogout" rel="nofollow noreferrer"><code>onLogout</code></a> event and redirected to wherever you wished.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-19T10:04:55.697Z
Answers.Text: I decided to stay hassle-free and keep only registration page. Craft login screen is good, no need to overwrite. Thank you anyway.
Answers.UserDisplayName: curious
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-16T13:28:17.530Z
Answers.Text: Can I add a FR? Add a config setting for `postLogoutRedirect` that we can set.
Answers.UserDisplayName: Siebird
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-16T19:38:53.067Z
Answers.Text: @Siebird - Yup... just create one here: https://github.com/craftcms/cms/issues
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-18T22:20:00.587Z
Answers.LastActivityDate: 2018-02-21T23:45:37.083Z
Answers.LastEditDate: 2018-02-21T23:45:37.083Z
Answers.UserDisplayName: Brad Bell
Body: <ol>
  <li>I have "manage" link that redirects to domain.com/login.</li>
  <li>"login" is custom front-end page that after logging in redirects to homepage.</li>
  <li>After logging in when I click "manage" again the domain.com/login redirects me to CP dashboard.</li>
  <li>Signing out from CP redirects me to default Craft login page.</li>
  </ol>
  
  <hr>
  
  <ol>
  <li>How to redirect directly to dashboard after logging in?</li>
  <li>How to redirect directly to domain.com/login or homepage after signing out?</li>
  </ol>
  
  <p>I'm also using <code>manager</code> as cpTrigger, and this is my config:</p>
  
  <pre><code>'postLoginRedirect' =&gt; 'manager',
  'logoutPath' =&gt; 'login',
  'cpTrigger' =&gt; 'manager',
  </code></pre>
  
  <p>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?</p>
  
  <p>login/index.html code:</p>
  
  <pre><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 %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-17T21:05:14.990Z
Comments.Text: I'm having a hard time following.  Can you share your `domain.com/login` template code? "How to redirect directly to dashboard after logging in?" Are you referring to Craft's dashboard or a front-end dashboard that you've created.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-18T14:09:59.000Z
Comments.Text: Hi @BradBell
  I'm referring to the Craft dashboard.
  I added login/index.html template code to the question.
Comments.UserDisplayName: curious
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-18T21:49:42.110Z
Comments.Text: ""login" is custom front-end page that after logging in redirects to homepage." If I'm following you, that's the current behavior you're seeing, but you want to change it to "1. How to redirect directly to dashboard after logging in?"
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-18T21:58:22.123Z
Comments.Text: @BradBell exactly
Comments.UserDisplayName: curious
Tags: <control-panel><form><config><login>
Title: Customizing front-end login/logout redirects
ThreadText: # Customizing front-end login/logout redirects
  
  (Asked by: username_0 on 2017-04-17)
  
  1. I have "manage" link that redirects to domain.com/login.
  2. "login" is custom front-end page that after logging in redirects to homepage.
  3. After logging in when I click "manage" again the domain.com/login redirects me to CP dashboard.
  4. Signing out from CP redirects me to default Craft login page.
  
  ---
  
  1. How to redirect directly to dashboard after logging in?
  2. 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' => 'manager',
  'logoutPath' => 'login',
  'cpTrigger' => '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 %}
            <div class="box">
  
            <form method="post" accept-charset="UTF-8">
            {{ getCsrfInput() }}
            <input type="hidden" name="action" value="users/login">
  
              {% if errorMessage is defined %}
               <article class="message is-danger">
                <div class="message-body">   
                 {{ errorMessage }}
                </div>
               </article>
              {% endif %}
  
              <div class="field">
                <p class="control has-icon">
                  <input class="input" id="loginName" type="text" name="loginName" placeholder="Email">
                  <span class="icon">
                  <i class="fa fa-envelope"></i>
                  </span>
                </p>
              </div>
  
                <div class="field">
                <p class="control has-icon">
                  <input class="input" id="password" type="password" name="password" placeholder="Password">
                  <span class="icon">
                  <i class="fa fa-lock"></i>
                  </span>
                </p>
              </div>
  
                <div class="field">
                <p class="control">
                <label class="checkbox">
                  <input type="checkbox" name="rememberMe" value="1">
                  Keep me logged in
                </label>
                </p>
              </div>
  
                <hr>
  
                <p class="control">
                  <button class="button is-primary" type="submit">Login</button>
                  <a class="button is-default" href="{{ siteUrl }}">Cancel</a>
  
                </p>
            </form>
            </div>
              <p class="has-text-centered">
                <a href="{{ url('login/register') }}">Register an Account</a>
                | 
                <a href="{{ url('login/forgotpassword') }}">Forgot password</a>
                | 
                <a href="{{ url('contact') }}">Need help?</a>
              </p>
  {% endblock %}
  
  ```
  
  **Tags:** control-panel, form, config, login
  
  > **Comments:**
  > **username_1**: I'm having a hard time following.  Can you share your `domain.com/login` template code? "How to redirect directly to dashboard after logging in?" Are you referring to Craft's dashboard or a front-end dashboard that you've created.  
  > **username_0**: Hi @username_1 I'm referring to the Craft dashboard. I added login/index.html template code to the question.  
  > **username_1**: ""login" is custom front-end page that after logging in redirects to homepage." If I'm following you, that's the current behavior you're seeing, but you want to change it to "1. How to redirect directly to dashboard after logging in?"  
  > **username_0**: @username_1 exactly  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-18. Score: 1
  
  > 1. How to redirect directly to dashboard after logging in?
  
  Since your login form is on the front-end of the site, the [postLoginRedirect](https://craftcms.com/docs/config-settings#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](https://craftcms.com/docs/config-settings#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](https://pluginfactory.io) that listened to the [`onLogout`](https://craftcms.com/docs/plugins/events-reference#userSession-onLogout) event and redirected to wherever you wished.
  
  > **Comments:**
  > **username_0**: I decided to stay hassle-free and keep only registration page. Craft login screen is good, no need to overwrite. Thank you anyway.  
  > **username_2**: Can I add a FR? Add a config setting for `postLogoutRedirect` that we can set.  
  > **username_1**: @username_2 - Yup... just create one here: https://github.com/craftcms/cms/issues  
  
  ---
  
  