ErrorsSign-in and identity · rule
type.auth_principal_construction
Caller is made from a record outside tests, fixtures and seeds.
Area 8, Sign-in and identity; not declinable; the next step is usually the agent's.
A caller only comes from signing in; tests, fixtures and seeds make one from a record:
principal { user: { subject: Member.handle }}type Handle = Text { max_length: 40}entity Member { id: Uuid handle: Handle { unique: true }}action act_as(member: Member) -> Principal.user { return Principal.user(member)}
error An action can't make a caller
--> main.jadpo:19:12
|19 | return Principal.user(member) | ^^^^^^^^^^^^^^ made from a record
- reason
- A caller only comes from signing in; tests, fixtures and seeds make one from a record with
Principal.user(...), and application code takes it as a parameter a route passes. - next
- Take a
Principal.userparameter, which the route passes ascurrent_principal.user(agent) - rule
- type.
auth_ principal_ construction - help
- https://jadpo.
dev/docs/errors/type. auth_ principal_ construction
Markdown for agents: /docs/errors/type.auth_principal_construction.md.Built from Jadpo main at aee2e8f.