Skip to content

Commit

Permalink
fix: Use correct typespec for AshAuthentication.Sender.send/3 callback
Browse files Browse the repository at this point in the history
In the Magic Link strategy, the `send` function is called with either a user (if logging in to an existing account) or just an email address (if creating a new account). The typespec should reflect this!
  • Loading branch information
sevenseacat authored Nov 13, 2024
1 parent 7c97924 commit fd9c168
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ash_authentication/sender.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ defmodule AshAuthentication.Sender do
@doc """
Sending callback.
This function will be called with the user, the token and any options passed
This function will be called with a value representing a user, the token and any options passed
to the module in the DSL.
"""
@callback send(user :: Resource.record(), token :: String.t(), opts :: list) :: :ok
@callback send(user :: Resource.record() | String.t(), token :: String.t(), opts :: list) :: :ok

@doc false
@spec __using__(any) :: Macro.t()
Expand Down

0 comments on commit fd9c168

Please sign in to comment.