fix a elixir warning
This commit is contained in:
@@ -160,18 +160,16 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
|
||||||
A logged user that is banned stays logged-in.
|
|
||||||
We need to block the person creation to prevent the user to create new content
|
|
||||||
TODO: Best should be to destroy the session but it seems hard to do with token behaviour.
|
|
||||||
Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842
|
|
||||||
Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842#note_2255364
|
|
||||||
"""
|
|
||||||
def create_person(
|
def create_person(
|
||||||
_parent,
|
_parent,
|
||||||
%{preferred_username: _preferred_username} = _args,
|
%{preferred_username: _preferred_username} = _args,
|
||||||
%{context: %{current_user: %{disabled: true} = _user} = _context} = _resolution
|
%{context: %{current_user: %{disabled: true} = _user} = _context} = _resolution
|
||||||
) do
|
) do
|
||||||
|
# A logged user that is banned stays logged-in.
|
||||||
|
# We need to block the person creation to prevent the user to create new content
|
||||||
|
# TODO: Best should be to destroy the session but it seems hard to do with token behaviour.
|
||||||
|
# Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842
|
||||||
|
# Link: https://framagit.org/kaihuri/mobilizon/-/issues/1842#note_2255364
|
||||||
{:error, :user_disabled}
|
{:error, :user_disabled}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user