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 ->
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user