View Source Mobilizon.GraphQL.Resolvers.User (Mobilizon v5.0.0-beta.1)
Handles the user-related GraphQL calls.
Summary
Functions
Change an user default actor
Register an user
Find an user by its ID
Return current logged-in user
List instance users
Login an user. Returns a token and the user
Refresh a token
Send the confirmation email again. We only do this to accounts not activated
Reset the password from an user
Send an email to reset the password from an user
Returns the list of draft events for the current user
Returns the list of groups this user is a member is a member of
Returns the list of events for all of this user's identities are going to
Validate an user, get its actor and a token
Functions
Change an user default actor
@spec create_user(any(), %{email: String.t()}, any()) :: {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}
Register an user:
- check registrations are enabled
- create the user
- send a validation email to the user
@spec find_user(any(), map(), Absinthe.Resolution.t()) :: {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}
Find an user by its ID
@spec get_current_user(any(), map(), Absinthe.Resolution.t()) :: {:error, :unauthenticated} | {:ok, Mobilizon.Users.User.t()}
Return current logged-in user
@spec list_users(any(), map(), Absinthe.Resolution.t()) :: {:ok, Mobilizon.Storage.Page.t(Mobilizon.Users.User.t())} | {:error, :unauthorized}
List instance users
@spec login_user(any(), map(), Absinthe.Resolution.t()) :: {:ok, map()} | {:error, :user_not_found | String.t()}
Login an user. Returns a token and the user
@spec logout(any(), map(), Absinthe.Resolution.t()) :: {:ok, String.t()} | {:error, :token_not_found | :unable_to_logout | :unauthenticated | :invalid_argument}
@spec refresh_token(any(), map(), Absinthe.Resolution.t()) :: {:ok, map()} | {:error, String.t()}
Refresh a token
Send the confirmation email again. We only do this to accounts not activated
@spec reset_password(map(), %{password: String.t(), token: String.t()}, map()) :: {:ok, map()} | {:error, String.t()}
Reset the password from an user
Send an email to reset the password from an user
@spec set_user_setting(map(), map(), map()) :: {:ok, Mobilizon.Users.Setting.t()} | {:error, any()}
Returns the list of draft events for the current user
Returns the list of groups this user is a member is a member of
Returns the list of events for all of this user's identities are going to
@spec user_settings(Mobilizon.Users.User.t(), map(), map()) :: {:ok, [Mobilizon.Users.Setting.t()]} | {:error, String.t()}
@spec validate_email(map(), %{token: String.t()}, map()) :: {:ok, Mobilizon.Users.User.t()} | {:error, String.t()}
Validate an user, get its actor and a token