You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading the policies on authorizer app and something came into my mind when I read the validation part. Shouldn't we catch all on validation failure? I mean, when the first function clause doesn't match.
defvalidate(%Conn{private: %{session: session}}=context)whenis_map(session)docasesessiondo%{subject_id: id,subject_type: type}whenis_binary(id)andtypein@subject_types->Logger.debug("Policity #{__MODULE__} validated with success"){:ok,context}_any->Logger.error("Policy #{__MODULE__} failed on validation because session is invalid"){:error,:unauthorized}endenddefvalidate(%Conn{private: %{session: _}})doLogger.error("Policy #{__MODULE__} failed on validation because session was not found"){:error,:unauthorized}end
The difference is that it returns a 50x instead of 403 because the process dies (right?)
The text was updated successfully, but these errors were encountered:
I was reading the policies on authorizer app and something came into my mind when I read the validation part. Shouldn't we catch all on validation failure? I mean, when the first function clause doesn't match.
The difference is that it returns a 50x instead of 403 because the process dies (right?)
The text was updated successfully, but these errors were encountered: