<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="123070" data-post-id="123070">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mythicalprogrammer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mythicalprogrammer/120/10430_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mythicalprogrammer
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I mean… I have a navbar with a logout button that still point to sessioncontroller delete. Not sure if that matter. I’m going to try your suggestion.</p>
<p>Oh… I think I know what’s happening:</p>
<p>I’m using <code>error_handler: Pow.Phoenix.PlugErrorHandler</code></p>
<p>Ah that’s the problem. I wanted to be lazy but turns out it was bad to be lazy. Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123070" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/93">Post #92</a>
	                </div>
	            </div>
              <div id="likers-container-123070" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123070"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #92"></div>
  </section>
</div>
    <div class="postbit" id="123090" data-post-id="123090">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="simonprev" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/simonprev/120/11757_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  simonprev
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for this library, we’ve been using it instead of Coherence for our new projects!</p>
<p>Is there an easy way to store sessions in the database with Ecto? The 2 provided solution “ets” and “mnesia” shows how to implement a backend for session but it’s not as simple as a “user_id” → “token” in the database. There is a concept of “keys” per user, invalidators…</p>
<p>Did someone already implemented this?</p>
<p>Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123090" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/94">Post #93</a>
	                </div>
	            </div>
              <div id="likers-container-123090" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123090"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #93"></div>
  </section>
</div>
    <div class="postbit" id="123504" data-post-id="123504">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="danschultzer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/danschultzer/120/4942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  danschultzer
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Pow Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mythicalprogrammer" data-post="93" data-topic="15807">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mythicalprogrammer/48/10430_2.png" class="avatar"> mythicalprogrammer:</div>
<blockquote>
<p>Oh… I think I know what’s happening:</p>
<p>I’m using <code>error_handler: Pow.Phoenix.PlugErrorHandler</code></p>
<p>Ah that’s the problem.</p>
</blockquote>
</aside>
<p>Yup, the guide shows how to set up the proper error handler since the default error handler assumes you don’t have custom routes <img src="https://forum.elixirforum.com/images/emoji/apple/smile.png?v=15" title=":smile:" class="emoji" alt=":smile:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group quote-modified" data-username="simonprev" data-post="94" data-topic="15807">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/simonprev/48/11757_2.png" class="avatar"> simonprev:</div>
<blockquote>
<p>Is there an easy way to store sessions in the database with Ecto? The 2 provided solution “ets” and “mnesia” shows how to implement a backend for session but it’s not as simple as a “user_id” -&gt; “token” in the database. There is a concept of “keys” per user, invalidators…</p>
</blockquote>
</aside>
<p>Sorry for the late response, I’ve been swamped!</p>
<p>I haven’t seen anyone implementing this. You should note that the store backends works as key-value cache stores, so there is no concept of relational structure or assumption of user association.</p>
<p>However, you should be able to set up an ecto schema with user association for it since since currently the cache store is used for session ids, reset password tokens and persistent session tokens. It would be safe for future releases if you just do some basic pattern matching.</p>
<p>You would need a way to invalidate the keys. I think the GenServer setup in the Mnesia cache works well for that. Since you would leverage the DB you just need to have namespace, key, user association and TTL, and a unique index on the namespace-key columns.</p>
<p>You can build from the Mnesia cache module. You would only have to change the <code>table_get/2</code>, <code>table_update/4</code>, <code>table_delete/2</code> and <code>table_keys/2</code> methods, and remove the mnesia logic for table initialization and namespace of keys.</p>
<p>I may post an example for ecto integration when I got some free time <img src="https://forum.elixirforum.com/images/emoji/apple/smile.png?v=15" title=":smile:" class="emoji" alt=":smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123504" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/95">Post #94</a>
	                </div>
	            </div>
              <div id="likers-container-123504" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123504"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #94"></div>
  </section>
</div>
    <div class="postbit" id="123632" data-post-id="123632">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kidbombay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kidbombay/120/10440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kidbombay
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We made a version of postgres session cache but it could probably use some more testing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123632" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/96">Post #95</a>
	                </div>
	            </div>
              <div id="likers-container-123632" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123632"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #95"></div>
  </section>
</div>
    <div class="postbit" id="123869" data-post-id="123869">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="djaouen" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/djaouen/120/7776_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  djaouen
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m trying to figure out how to add “Login” and “Sign Up” breadcrumbs to my site.  The way I do this on the rest of the site is to create a list of tuples of <code>{name, route}</code> in my controller actions, but I’m not sure how to do this for the Login and Sign Up routes.  Any advice here?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123869" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/97">Post #96</a>
	                </div>
	            </div>
              <div id="likers-container-123869" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123869"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #96"></div>
  </section>
</div>
    <div class="postbit" id="123889" data-post-id="123889">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="danschultzer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/danschultzer/120/4942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  danschultzer
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Pow Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There are several ways of doing this. I would recommend moving the logic to relevant view module.</p>
<p>In the below example I make the assumption that you continue to assign breadcrumbs in your other controllers as <code>:breadcrumbs</code>, and just want to catch the Pow registration and session controllers (untested code, from the top of my head):</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyAppWeb.LayoutView do
  use MyAppWeb, :view

  alias MyAppWeb.Router.Helpers, as: Routes

  @spec breadcrumbs(Plug.Conn.t()) :: [{binary(), binary()}]
  def breadcrumbs(%{assigns: %{breadcrumbs: breadcrumbs}}), do: breadcrumbs
  def breadcrumbs(%{private: %{phoenix_controller: Pow.Phoenix.RegistrationController, phoenix_action: :new}}), do: [{"Sign up", Routes.pow_registration_path(conn, :new)}]
  def breadcrumbs(%{private: %{phoenix_controller: Pow.Phoenix.SessionController, phoenix_action: :new}}), do: [{"Sign in", Routes.pow_session_path(conn, :new)}]
  def breadcrumbs(_conn), do: []
end
</code></pre>
<p>Now you just call <code>breadcrumbs(@conn)</code> in your layout template (or partial) to fetch the list.</p>
<p><em>Edit:</em> If a user inputs an invalid password the breadcrumbs in the above example will be empty. You can either change the pattern matching to handle multiple actions for the controller:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def breadcrumbs(%{private: %{phoenix_controller: Pow.Phoenix.SessionController, phoenix_action: action}}) when action in [:new, :create], do: [{"Sign in", Routes.pow_session_path(conn, :new)}]
</code></pre>
<p>Or you could even just use the view and template instead of controller and action:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def breacrumbs(%{private: %{phoenix_view: Pow.Phoenix.RegistrationView, phoenix_template: "new.html"}})), do: [{"Sign in", Routes.pow_session_path(conn, :new)}]
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123889" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/98">Post #97</a>
	                </div>
	            </div>
              <div id="likers-container-123889" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123889"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #97"></div>
  </section>
</div>
    <div class="postbit" id="123971" data-post-id="123971">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Kurisu" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Kurisu/120/14820_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Kurisu
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m working on an umbrella project that has one admin web app.</p>
<p>For the login page I would like to disable the default app layout (since it would show informations we don’t want guest to see) or at least use a minimalistic view layout.</p>
<p>When I tried to do something like<br>
<code>plug :put_layout, false</code> or <code>plug :put_layout, {AdminWeb.LayoutView, :login}</code><br>
in the <code>router.ex</code> then pipe only the login route through it, <code>Pow</code> threw an error about building the template layout.</p>
<p>Please, is there a way to fix this, or should I write a custom session_controller ?</p>
<p><strong>– more details in the case it can help –</strong></p>
<p>Since it is an admin web app, to disable registration I generated the templates and add the app <code>view_module</code> in <code>pow</code> config, then add routes only to edit and delete profile.<br>
For session routes I also added them by hand.<br>
In other words I didn’t use <code>Pow</code> macro such as <code>pow_routes()</code> or <code>pow_sessions()</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123971" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/99">Post #98</a>
	                </div>
	            </div>
              <div id="likers-container-123971" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123971"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #98"></div>
  </section>
</div>
    <div class="postbit" id="124001" data-post-id="124001">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="besnikshabani" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  besnikshabani
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hello Dan,</p>
<p>I want to migrate a project from coherence to pow, for that purpose I tried out your library in a new dummy project.</p>
<p>First I want to ask if multiple user support is still available in the latest versions?</p>
<p><a href="https://github.com/danschultzer/pow/blob/e725d04b2a9e91565a1c7c1075411e0ae2cec792/guides/MULTIPLE_USERS_IN_SAME_SCOPE.md" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/danschultzer/pow/blob/e725d04b2a9e91565a1c7c1075411e0ae2cec792/guides/MULTIPLE_USERS_IN_SAME_SCOPE.md</a></p>
<p>I couldn’t get it to work following your instructions in the guide above and your comments in some github issues. Whenever I access one of the scopes it always tries to log the user from the last plug in the endpoint (Pow.Plug.Session) and that user is assigned to both current user keys (current_user and current_admin).</p>
<p>Also the command for generating templates and views with namespaces didn’t work properly as it didn’t use the namespace names in generating the locations of the files. The dummy project is available at the link below, in it we created the namespace folder names manually.</p>
<p>Thank you!</p>
<p><a href="https://github.com/martint95/pow-multi-user" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/martint95/pow-multi-user</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="124001" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/100">Post #99</a>
	                </div>
	            </div>
              <div id="likers-container-124001" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="124001"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #99"></div>
  </section>
</div>
    <div class="postbit" id="124013" data-post-id="124013">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="danschultzer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/danschultzer/120/4942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  danschultzer
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Pow Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Kurisu" data-post="99" data-topic="15807">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kurisu/48/14820_2.png" class="avatar"> Kurisu:</div>
<blockquote>
<p>When I tried to do something like<br>
<code>plug :put_layout, false</code> or <code>plug :put_layout, {AdminWeb.LayoutView, :login}</code><br>
in the <code>router.ex</code> then pipe only the login route through it, <code>Pow</code> threw an error about building the template layout.</p>
</blockquote>
</aside>
<p>That looks like an issue with Phoenix rather than Pow. How does your routes and pipeline look? And what was the exact error thrown? It should be something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">pipeline :admin_layout do
  plug :put_layout, {AdminWeb.LayoutView, :login}
end

scope "/" do
  pipe_through [:browser, :admin_layout]

  pow_session_routes() # Or the custom route setup you have written
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="124013" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/101">Post #100</a>
	                </div>
	            </div>
              <div id="likers-container-124013" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="124013"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #100"></div>
  </section>
</div>
    <div class="postbit" id="124017" data-post-id="124017">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="danschultzer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/danschultzer/120/4942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  danschultzer
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Pow Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="besnikshabani" data-post="100" data-topic="15807">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/65b543/48.png" class="avatar"> besnikshabani:</div>
<blockquote>
<p>First I want to ask if multiple user support is still available in the latest versions?</p>
</blockquote>
</aside>
<p>Yes, but <a href="https://github.com/danschultzer/pow/pull/24#issuecomment-439668529" rel="noopener nofollow ugc">the PR</a> you’ve looked at was closed since I didn’t like the approach. What I would recommend is to set up an umbrella app with two separate web apps that each has their own Pow setup.</p>
<p>It’s possible to run Pow with two different user schemas in the same web app too, but all the work lies on the shoulders of the developer.</p>
<p>If you go down that route (I strongly recommend just separating the context with an umbrella app, or instead have user roles), then you would need to set up both routes and endpoint to handle multiple contexts, as well as some handling of routes.</p>
<p>Something like this (untested):</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># endpoint.ex

plug Plug.Session,
  otp_app: :my_app,
  user: MyApp.Admins.Admin,
  current_user_assigns_key: :current_admin,
  session_key: "admin_auth",
  session_store: {Pow.Store.CredentialsCache, ttl: :timer.minutes(30), namespace: "admin_credentials"},
  routes_backend: MyAppWeb.AdminPowRoutes

plug Plug.Session, otp_app: :my_app
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># router.ex

pipeline :admin do
  plug Pow.Plug.Session,
    user: MyApp.Admins.Admin,
    current_user_assigns_key: :current_admin,
    session_key: "admin_auth",
    session_store: {Pow.Store.CredentialsCache, ttl: :timer.minutes(30), namespace: "admin_credentials"},
    routes_backend: MyAppWeb.AdminPowRoutes
end

scope "/admin", as: "admin" do
  pipe_through [:browser, :admin]

  pow_routes()
end

scope "/" do
  pipe_through :browser

  pow_routes()
end
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># admin_pow_routes.ex

defmodule MyAppWeb.AdminPowRoutes do
  use Pow.Phoenix.Routes
  alias MyAppWeb.Router.Helpers, as: Routes

  def url_for(conn, verb, vars \\ [], query_params \\ []) do
     plug = admin_namespace(plug)

     Pow.Phoenix.Routes.url_for(conn, plug, verb, vars, query_params)
  end

  def path_for(conn, plug, verb, vars \\ [], query_params \\ []) do
     plug = admin_namespace(plug)

     Pow.Phoenix.Routes.path_for(conn, plug, verb, vars, query_params)
  end

  defp admin_namespace(plug) do
    [web_module | rest] = Module.split(plug)

    Module.concat([web_module, "Admin"] ++ rest)
  end
end
</code></pre>
<p>You can take a look at the thought process I went through when I was working on this in the <a href="https://github.com/danschultzer/pow/pull/24" rel="noopener nofollow ugc">#24</a> <a href="https://github.com/danschultzer/pow/issues/53" rel="noopener nofollow ugc">#53</a> and <a href="https://github.com/danschultzer/pow/pull/56" rel="noopener nofollow ugc">#56</a> issues.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="124017" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/pow-robust-modular-extendable-user-authentication-and-management-system/15807/102">Post #101</a>
	                </div>
	            </div>
              <div id="likers-container-124017" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="124017"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #101"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/15807/load_more?page=11">Load more posts (141 remaining)</a>
</div></template></turbo-stream>