mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-01 17:53:00 +01:00
feat: add hook to check decoded JWT after success authentication (#3446)
This commit is contained in:
parent
d64e453364
commit
a76531b90b
@ -102,10 +102,11 @@ check_jwt_token(User, Server, Token) ->
|
|||||||
error ->
|
error ->
|
||||||
false;
|
false;
|
||||||
{ok, SJID} ->
|
{ok, SJID} ->
|
||||||
try
|
try jid:decode(SJID) of
|
||||||
JID = jid:decode(SJID),
|
JID ->
|
||||||
(JID#jid.luser == User) andalso
|
(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, _} ->
|
catch error:{bad_jid, _} ->
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user