plug_mishka_auth v0.0.2 MishkaAuth.Client.Helper.HandleSocialRequest View Source
Link to this section Summary
Functions
creates an Identity data map and saves after finding user but there is not an Identity for this provider concerned
main function which helps us to call back router and handle social request. is there a user we want ro create. register or sign in
if user email exist or not this function helps to update Identity or save data on temporary redis table
this function checks your databse if user email exist or not
if there are errors after returning social provider, this function create a list of errors
get basic data after sending provider output to callback router
update an Identity data map and edit after finding user, there is an Identity for this provider concerned
Link to this section Types
Specs
conn() :: Plug.Conn.t()
Specs
Specs
Specs
strategy_type() :: atom()
Specs
temporary_user_uniq_id() :: String.t()
Specs
token() :: String.t()
Link to this section Functions
Specs
add_user_identity(Ecto.Schema.t(), provider(), social_uid(), token()) :: {:ok, :add_identity, Ecto.Schema.t()} | {:error, :add_identity, Ecto.Changeset.t()}
creates an Identity data map and saves after finding user but there is not an Identity for this provider concerned
back_request(auth, atom, temporary_user_uniq_id, strategy_type, conn)
View SourceSpecs
back_request( %Ueberauth.Auth{ credentials: term(), extra: term(), info: term(), provider: term(), strategy: term(), uid: term() } | %Ueberauth.Failure{errors: term(), provider: term(), strategy: term()}, atom(), temporary_user_uniq_id(), strategy_type(), Plug.Conn.t() ) :: {:ok, :config_user_social_data, :exist_user, token(), token()} | {:ok, :config_user_social_data, :none_user, temporary_user_uniq_id()} | {:error, :get_basic_data, any()} | {:error, :config_user_social_data, :exist_user | :none_user} | Plug.Conn.t()
main function which helps us to call back router and handle social request. is there a user we want ro create. register or sign in
Specs
config_user_social_data( {:ok, :edit_identity, Ecto.Schema.t()} | {:ok, :add_identity, Ecto.Schema.t()} | {:ok, :create_or_update_user, :save_temporary_social_data, temporary_user_uniq_id()}, strategy_type(), conn() ) :: Plug.Conn.t()
create_or_update_user(arg, provider, token, temporary_user_uniq_id)
View SourceSpecs
create_or_update_user( {:does_user_email_exist?, {:error, :find_user_with_email}, map(), String.t()} | {:does_user_email_exist?, {:ok, :find_user_with_email, Ecto.Schema.t()}, map(), String.t()}, atom(), token(), temporary_user_uniq_id() ) :: {:ok, :create_or_update_user, :save_temporary_social_data, temporary_user_uniq_id()} | {:ok, :add_identity | :edit_identity, Ecto.Schema.t()}
if user email exist or not this function helps to update Identity or save data on temporary redis table
Specs
does_user_email_exist?({:ok, :get_basic_data, map(), String.t()}) :: {:does_user_email_exist?, {:error, :find_user_with_email}, map(), String.t()} | {:does_user_email_exist?, {:ok, :find_user_with_email, Ecto.Schema.t()}, map(), String.t()} | {:error, :get_basic_data, any()}
this function checks your databse if user email exist or not
Specs
if there are errors after returning social provider, this function create a list of errors
Specs
get_basic_data( %Ueberauth.Auth.Info{ birthday: term(), description: term(), email: term(), first_name: term(), image: term(), last_name: term(), location: term(), name: term(), nickname: term(), phone: term(), urls: term() }, atom(), integer() | float() | String.t() ) :: {:ok, :get_basic_data, map(), String.t()}
get basic data after sending provider output to callback router
Specs
update_user_identity(Ecto.Schema.t(), social_uid(), Ecto.Schema.t(), token()) :: {:ok, :edit_identity, Ecto.Schema.t()}
update an Identity data map and edit after finding user, there is an Identity for this provider concerned