ProcaWeb.Plugs.TokenAuthPlug (proca v3.4.1)

A plug that reads JWT from Authorization header and authenticates the user.

options:

  • query_param - specify if you want to fetch JWT from a query param
  • enable_session - set user also in phoenix session
  • email_path - list of keys to get email from in JWT (default ["email"])
  • email_verified_path = list of keys to get email verified info (default user_metadata.email_verified)
  • external_id_path - list of keys to get external_id from JWT (default ["sub"])

Link to this section Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Return the current user context based on the authorization header

Link to this section Functions

Link to this function

call(conn, opts)

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Link to this function

token_auth(conn, opts)

Return the current user context based on the authorization header