Skip to content

Commit

Permalink
Fix wrong identity fetched (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
robvandenbogaard authored and ddeboer committed Jan 16, 2019
1 parent 52d95cd commit 802effb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/mod_ginger_base/controllers/controller_auth.erl
Expand Up @@ -98,6 +98,12 @@ to_json(Req, State = #state{mode = status}) ->
%%%-----------------------------------------------------------------------------

user(Id, Context) ->
#{ <<"identity">> => proplists:delete(propb, m_identity:get(Id, Context))
Identity =
% m_identity:get_rsc fetches the identity details linked to the rsc id
case m_identity:get_rsc_by_type(Id, username_pw, Context) of
[FirstIdentity|_Rest] -> proplists:delete(propb, FirstIdentity);
_ -> null
end,
#{ <<"identity">> => Identity
, <<"resource">> => m_ginger_rest:rsc(Id, Context)
}.

0 comments on commit 802effb

Please sign in to comment.