24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00

feat: add hook to check decoded JWT after success authentication (#3446)

This commit is contained in:
Pouriya 2020-12-14 10:44:58 +03:30 committed by GitHub
parent d64e453364
commit a76531b90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,10 +102,11 @@ check_jwt_token(User, Server, Token) ->
error ->
false;
{ok, SJID} ->
try
JID = jid:decode(SJID),
try jid:decode(SJID) of
JID ->
(JID#jid.luser == User) andalso
(JID#jid.lserver == Server)
(JID#jid.lserver == Server) andalso
ejabberd_hooks:run_fold(check_decoded_jwt, Server, true, [Fields, Signature, User])
catch error:{bad_jid, _} ->
false
end