mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-10 01:35:33 +00:00
16 lines
437 B
Elixir
16 lines
437 B
Elixir
defmodule WandererApp.Api.ActorWithMap do
|
|
@moduledoc """
|
|
Wraps a user and map together as an actor for token-based authentication.
|
|
|
|
When API requests use Bearer token auth, the token identifies both the user
|
|
(map owner) and the map. This struct allows passing both through Ash's actor system.
|
|
"""
|
|
|
|
@enforce_keys [:user, :map]
|
|
defstruct [:user, :map]
|
|
|
|
def new(user, map) do
|
|
%__MODULE__{user: user, map: map}
|
|
end
|
|
end
|