AshAuthentication.Strategy.Firebase.Transformer
(ash_authentication_firebase v1.1.0)
Copy Markdown
View Source
DSL transformer for firebase strategies.
Summary
Functions
Runs the compile-time transformation for a firebase strategy.
Functions
@spec transform(AshAuthentication.Strategy.Firebase.t(), map()) :: {:ok, map()} | {:error, Spark.Error.DslError.t() | term()}
Runs the compile-time transformation for a firebase strategy.
Three responsibilities:
- Fill in defaults for
register_action_name(:register_with_<name>) andsign_in_action_name(:sign_in_with_<name>) when they are not set explicitly. - Validate the action gated by
registration_enabled?— whentrue, the register action must be a:createaction with a non-nullable:user_infomap argument andupsert?: trueplus anupsert_identity, so repeat sign-ins update the existing user rather than creating duplicates. Whenfalse, the sign-in action must be a:readaction with the same:user_infoargument shape. - Register both action names with AshAuthentication so the strategy plug can resolve them at runtime.
Returns {:ok, dsl_state} on success or {:error, Spark.Error.DslError.t()}
when validation fails. Called automatically by Spark via the strategy's
transform/2 delegate; not intended to be invoked directly.