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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The „automated“ places to invalidate existing sessions could be on logout or when the password is reset. But also don‘t think you need automated ways to use the information. It might be just as useful to be able to react manually to compromised sessions e.g. when being informed by users.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="237535" 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/why-does-phx-gen-auth-create-a-session-token-and-other-questions/31185/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-237535" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="237535"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="237594" data-post-id="237594">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>IMHO it all depends upon your business use cases.  For instance, you could allow the login but send the user an email or SMS to confirm a login from an unusual location (i.e. different country, state, etc.) and allow the user to either accept or reject via link.  You could then automatically logout the invalid session if they reject it…so it’s semi-automated.</p>
<p>I’m not sure any fully automated mechanism will be user-friendly…except perhaps if they are on mobile and the IP address is from a vastly different location than where the token was issued, in which case you would delete the session and just have them authenticate again.</p>
<p>To do any of those, you’d need to also record the IP address when the user logs in and the session token is issued, so there would be some modifications to the generated code, but based upon your specific business logic…and you could defer that functionality to a later date with the generated model.  However, if you didn’t do the session token at the start, it would be harder to implement later.</p>
<p>For my use case, I was proposing having a section in the account settings page to show active sessions and allow the user to label the known logins because we have both web and mobile (possibly multiple devices) for the same user that could be simultaneously active.  …but that’s my business case. YMMV</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="237594" 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/why-does-phx-gen-auth-create-a-session-token-and-other-questions/31185/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-237594" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="237594"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>