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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I understand about the password but it is being hashed somewhere but did not include it coz my problem was the exception being thrown. What is the best way to match it <a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</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="128050" 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/strange-caseclauseerror/22362/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-128050" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128050"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="128051" data-post-id="128051">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Well, let’s think about the control flow you might want. <code>get_user_by_email!</code> uses <code>Repo.get_by!</code>. What happens if it doesn’t return any records? It raises an exception. This means that you’d need to handle it with <code>try / catch</code> in your controller, but this probably isn’t what you want. So I’d get rid of the <code>!</code> on <code>get_by</code> as well as on <code>get_user_by_email</code> to start with.</p>
<p>So now the question: what does <code>get_by</code> return? Well, it returns either the struct that that you asked for, or <code>nil</code>. So you need to handle the result out of <code>get_user_by_email</code> based on whether the result is <code>nil</code> or not. <code>if</code> is one option, pattern matching on <code>%Library.User{}</code> is another. I’ll leave the actual refactoring of the controller action as an exercise for the reader.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128051" 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/strange-caseclauseerror/22362/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-128051" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128051"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="128053" data-post-id="128053">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a> thanks for the response!<br>
I tried removing the <code>!</code> at both <code>get_user_by_email</code> and <code>get_by</code>.<br>
I also tried refactoring the SessionController to:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">case Library.get_user_by_email(email) do
   {user} -&gt;
      conn
      |&gt; put_view(LibraryApiWeb.SessionView)
      |&gt; render("token.json", user: user)
   {nil} -&gt;
      conn
      |&gt; put_status(:unauthorized)
      |&gt; put_view(LibraryApiWeb.ErrorView)
      |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
   {:error, _reason} -&gt;
      conn
      |&gt; put_status(:unauthorized)
      |&gt; put_view(LibraryApiWeb.ErrorView)
      |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
end
</code></pre>
<p>but the following error bugged me:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; [info] POST /api/session
iex(1)&gt; [debug] Processing with LibraryApiWeb.SessionController.create/2
  Parameters: %{"email" =&gt; "maria@hello.com", "password" =&gt; "[FILTERED]"}
  Pipelines: [:api]
iex(1)&gt; [debug] QUERY OK source="users" db=0.0ms
SELECT u0."id", u0."email", u0."password_hash", u0."username", u0."inserted_at", u0."updated_at" FROM "users" AS u0 WHERE (u0."email" = $1) ["maria@hello.com"]
iex(1)&gt; [info] Converted error {:case_clause, %LibraryApi.Library.User{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "users"&gt;, email: "maria@hello.com", id: 4, inserted_at: ~N[2019-05-12 08:41:18], password: nil, password_confirmation: nil, password_hash: "$2b$12$7qHpuOzPJaJShZoO4DCmAe9K/vHvsGwGPRlVmGzHQUlLkCBpgOZ82", updated_at: ~N[2019-05-12 08:41:18], username: "maria"}} to 500 response
iex(1)&gt; [info] Sent 500 in 78ms
iex(1)&gt; [error] #PID&lt;0.451.0&gt; running LibraryApiWeb.Endpoint (connection #PID&lt;0.450.0&gt;, stream id 1) terminated
Server: localhost:4000 (http)
Request: POST /api/session
** (exit) an exception was raised:
    ** (CaseClauseError) no case clause matching: %LibraryApi.Library.User{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "users"&gt;, email: "maria@hello.com", id: 4, inserted_at: ~N[2019-05-12 08:41:18], password: nil, password_confirmation: nil, password_hash: "$2b$12$7qHpuOzPJaJShZoO4DCmAe9K/vHvsGwGPRlVmGzHQUlLkCBpgOZ82", updated_at: ~N[2019-05-12 08:41:18], username: "maria"}
        (library_api) lib/library_api_web/controllers/session_controller.ex:7: LibraryApiWeb.SessionController.create/2
        (library_api) lib/library_api_web/controllers/session_controller.ex:1: LibraryApiWeb.SessionController.action/2
        (library_api) lib/library_api_web/controllers/session_controller.ex:1: LibraryApiWeb.SessionController.phoenix_controller_pipeline/2
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.plug_builder_call/2
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.call/2
        (phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:33: Phoenix.Endpoint.Cowboy2Handler.init/2
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_stream_h.erl:296: :cowboy_stream_h.execute/3
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_stream_h.erl:274: :cowboy_stream_h.request_process/3

        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
</code></pre>
<p>There is a line in that iex console dump that catches my eye</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; [info] Converted error {:case_clause, %LibraryApi.Library.User{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "users"&gt;, email: "maria@hello.com", id: 4, inserted_at: ~N[2019-05-12 08:41:18], password: nil, password_confirmation: nil, password_hash: "$2b$12$7qHpuOzPJaJShZoO4DCmAe9K/vHvsGwGPRlVmGzHQUlLkCBpgOZ82", updated_at: ~N[2019-05-12 08:41:18], username: "maria"}} to 500 response
</code></pre>
<p>What does <code>Converted error</code> mean?</p>
<p>Also there was a warning before that:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">warning: this clause cannot match because a previous clause at line 8 always matches
  lib/library_api_web/controllers/session_controller.ex:12
</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="128053" 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/strange-caseclauseerror/22362/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-128053" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128053"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="128054" data-post-id="128054">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Got already beyond the <code>CaseClauseError</code> by editing the SessionController from:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def create(conn, %{"email" =&gt; email, "password" =&gt; _password}) do
    case Library.get_user_by_email(email) do
      {user} -&gt;
        conn
        |&gt; put_view(LibraryApiWeb.SessionView)
        |&gt; render("token.json", user: user)
      {nil} -&gt;
        conn
        |&gt; put_status(:unauthorized)
        |&gt; put_view(LibraryApiWeb.ErrorView)
        |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
      {:error, _reason} -&gt;
        conn
        |&gt; put_status(:unauthorized)
        |&gt; put_view(LibraryApiWeb.ErrorView)
        |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
    end
  end
</code></pre>
<p>to</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def create(conn, %{"email" =&gt; email, "password" =&gt; _password}) do
    case Library.get_user_by_email(email) do
      user -&gt;
        conn
        |&gt; put_view(LibraryApiWeb.SessionView)
        |&gt; render("token.json", user: user)
      nil -&gt;
        conn
        |&gt; put_status(:unauthorized)
        |&gt; put_view(LibraryApiWeb.ErrorView)
        |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
      {:error, _reason} -&gt;
        conn
        |&gt; put_status(:unauthorized)
        |&gt; put_view(LibraryApiWeb.ErrorView)
        |&gt; render("401.json-api", %{detail: "Error logging in a user with that email and password"})
    end
  end
</code></pre>
<p>This means my controller is already working and now another error is hounding me concerning JWT using <code>Joken</code> in my SessionView:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def render("token.json", %{user: user}) do
    mydata = %{id: user.id, email: user.email, username: user.username}
    jwt = %{data: mydata, sub: user.id}
    |&gt; Joken.generate_and_sign(nil, Joken.Signer.create("HS512", "SOMESECRETVALUE"))
    #IO.inspect jwt
    %{token: jwt.token}
  end
</code></pre>
<p>the error is:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(1)&gt; [info] Converted error :badarg to 500 response
iex(1)&gt; [info] Sent 500 in 94ms
iex(1)&gt; [error] #PID&lt;0.449.0&gt; running LibraryApiWeb.Endpoint (connection #PID&lt;0.448.0&gt;, stream id 1) terminated
Server: localhost:4000 (http)
Request: POST /api/session
** (exit) an exception was raised:
    ** (ArgumentError) argument error
        :erlang.apply({:ok, "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.e30.OcmgLBuda2S8amZVN2V7ux2RdWJJKZiSZAv2IBndBQjuiWyoHmge8bmufXrA92wPCZLO0xXEA-b41fy7oOWNOg", %{}}, :token, [])
        (library_api) lib/library_api_web/views/session_view.ex:10: LibraryApiWeb.SessionView.render/2
        (phoenix) lib/phoenix/view.ex:399: Phoenix.View.render_to_iodata/3
        (phoenix) lib/phoenix/controller.ex:729: Phoenix.Controller.__put_render__/5
        (phoenix) lib/phoenix/controller.ex:746: Phoenix.Controller.instrument_render_and_send/4
        (library_api) lib/library_api_web/controllers/session_controller.ex:1: LibraryApiWeb.SessionController.action/2
        (library_api) lib/library_api_web/controllers/session_controller.ex:1: LibraryApiWeb.SessionController.phoenix_controller_pipeline/2
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:275: Phoenix.Router.__call__/1
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.plug_builder_call/2
        (library_api) lib/library_api_web/endpoint.ex:1: LibraryApiWeb.Endpoint.call/2
        (phoenix) lib/phoenix/endpoint/cowboy2_handler.ex:33: Phoenix.Endpoint.Cowboy2Handler.init/2
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_handler.erl:41: :cowboy_handler.execute/2
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_stream_h.erl:296: :cowboy_stream_h.execute/3
        (cowboy) d:/@@@/@gilbertc77/library_api/deps/cowboy/src/cowboy_stream_h.erl:274: :cowboy_stream_h.request_process/3

        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
</code></pre>
<p>How can I extract the token from the <code>jwt</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="128054" 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/strange-caseclauseerror/22362/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-128054" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128054"
                     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 #14"></div>
  </section>
</div>
    <div class="postbit" id="128056" data-post-id="128056">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="greyhwndz" data-post="15" data-topic="22362">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/48/503_2.png" class="avatar"> greyhwndz:</div>
<blockquote>
<p>How can I extract the token from the <code>jwt</code> ?</p>
</blockquote>
</aside>
<p>Use <code>IO.inspect</code> on the <code>jwt</code> value to figure out what its shape is if you can’t determine that from the error message. Then, based on its shape, consider how you might want to change <code>jwt =</code> so that <code>jwt</code> is bound to just the token string and not the entire return result.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128056" 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/strange-caseclauseerror/22362/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-128056" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128056"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="128058" data-post-id="128058">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a> thanks I have the following code now for my SessionView:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule LibraryApiWeb.SessionView do
  use LibraryApiWeb, :view

  def render("token.json", %{user: user}) do
    data = %{id: user.id, email: user.email, username: user.username}
    jwt = %{data: data, sub: user.id}
    theToken = Joken.generate_and_sign!(jwt, nil, Joken.Signer.create("HS512", "SOMESECRETVALUE"))
    %{token: theToken}
  end
end
</code></pre>
<p>The current problem that I am facing is that the generated token is invalid.<br>
What could I be doing wrong with Joken this time?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128058" 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/strange-caseclauseerror/22362/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-128058" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128058"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="128059" data-post-id="128059">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You have a variable here <code>theToken</code>. Do you understand what it is? What type of datastructure is it? A string? A map? A tuple?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128059" 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/strange-caseclauseerror/22362/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-128059" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128059"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="128060" data-post-id="128060">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It is a string <a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a>.<br>
That last line produces:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{
    "token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.e30.OcmgLBuda2S8amZVN2V7ux2RdWJJKZiSZAv2IBndBQjuiWyoHmge8bmufXrA92wPCZLO0xXEA-b41fy7oOWNOg"
}
</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="128060" 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/strange-caseclauseerror/22362/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-128060" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128060"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="128061" data-post-id="128061">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah yes, that is correct now, you changed from <code>Joken.generate_and_sign</code> which you had in the previous post to <code>Joken.generate_and_sign!</code>. <code>Joken.generate_and_sign</code> returns a tuple, <code>Joken.generate_and_sign!</code> returns a string. However if you changed that it shoul dhave solved yout <code>:erlang.apply</code> error, so what’s the new error you have?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128061" 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/strange-caseclauseerror/22362/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-128061" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128061"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="128062" data-post-id="128062">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="greyhwndz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/greyhwndz/120/503_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  greyhwndz
                    <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>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There are no more errors <a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a>!<br>
Only that the generated token seems to not have a payload when I paste it into the debugger in <a href="http://jwt.io" rel="noopener nofollow ugc">http://jwt.io</a>.<br>
I might be doing something wrong along the way. Something like a logical error</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="128062" 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/strange-caseclauseerror/22362/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-128062" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="128062"
                     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 #20"></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/22362/load_more?page=3">Load more posts (13 remaining)</a>
</div></template></turbo-stream>