./ct_report/coverage/mongoose_graphql_user_auth_info.COVER.html
1 | -module(mongoose_graphql_user_auth_info). |
|
2 | -behaviour(mongoose_graphql). |
|
3 |
|
|
4 | -export([execute/4]). |
|
5 |
|
|
6 | -ignore_xref([execute/4]). |
|
7 |
|
|
8 | execute(#{authorized := Authorized}, user, <<"authStatus">>, _Args) -> |
|
9 | 2 | case Authorized of |
10 | true -> |
|
11 | 1 | {ok, 'AUTHORIZED'}; |
12 | false -> |
|
13 | 1 | {ok, 'UNAUTHORIZED'} |
14 | end; |
|
15 | execute(Ctx, user, <<"username">>, _Args) -> |
|
16 | 2 | case maps:get(user, Ctx, null) of |
17 | 1 | null -> {ok, null}; |
18 | 1 | User -> {ok, jid:to_binary(User)} |
19 | end. |
|
Line | Hits | Source |
---|