   end
 
   @doc false
+  @spec detokenize(Phoenix.Socket.t() | Plug.Conn.t(), String.t(), String.t()) :: term() | no_return
   def detokenize(socket, token, salt \\ "drab token") do
     case Phoenix.Token.verify(socket, salt, token, max_age: 86_400) do
       {:ok, detokenized} ->


  # returns the drab_pid from socket
  @doc "Extract Drab PID from the socket"
  def pid(socket) do
    socket.assigns.__drab_pid
  end

  # if module is commander or controller with drab enabled, it has __drab__/0 function with Drab configuration
  defp commander_config(module) do
    module.__drab__()
  end


  # returns the controller name used with the socket
  @doc false
  @spec get_controller(Phoenix.Socket.t()) :: atom
  def get_controller(socket) do
    socket.assigns.__controller
  end

  # returns the view name used with the socket
  @doc false
  @spec get_view(Phoenix.Socket.t()) :: atom
  def get_view(socket) do
    controller = socket.assigns.__controller
    controller.__drab__()[:view]
