πUsers & Authentication
Users
defmodule PetalPro.Accounts.User do
...
schema "users" do
field :name, :string
field :email, :string
field :password, :string, virtual: true, redact: true
field :hashed_password, :string, redact: true
field :confirmed_at, :naive_datetime
field :is_admin, :boolean, default: false
field :avatar, :string
field :last_signed_in_ip, :string
field :last_signed_in_datetime, :utc_datetime
field :is_subscribed_to_marketing_notifications, :boolean, default: true
field :is_suspended, :boolean, default: false
field :is_deleted, :boolean, default: false
field :is_onboarded, :boolean, default: false
field :current_org, :map, virtual: true
many_to_many :orgs, Org, join_through: "orgs_memberships", unique: true
timestamps()
end
...
endField
Type
Description
Authentication
Setting and accessing the current user
Controller actions
Live views
Social login providers
How does it work?
How does this fit in with the existing `user` schema?
What if the user forgets what social login they used?
Setup Google sign in
Setup Github sign in
Adding more providers
Passwordless

How passwordless works



Passwordless process:
Two-factor authentication (2FA) with TOTP




How is TOTP implemented?

How to turn off 2FA


Was this helpful?
