I like the refactoring you've done. I think we could take things just a bit further to avoid using badmatch error as bad sig return value. Something like:
```
case {decrypt_sig(AuthSig, PublicKey), BodyHash} of
    {Plain, ContentHash} ->
        {name, UserId};
     _ ->
        {no_authn, bad_sig}
end
```