diff --git a/documentation/tutorials/github.md b/documentation/tutorials/github.md index 44370a0..286ef71 100644 --- a/documentation/tutorials/github.md +++ b/documentation/tutorials/github.md @@ -117,7 +117,7 @@ defmodule MyApp.Accounts.User do argument :user_info, :map, allow_nil?: false argument :oauth_tokens, :map, allow_nil?: false upsert? true - upsert_identity :email + upsert_identity :unique_email # Required if you have token generation enabled. change AshAuthentication.GenerateTokenChange @@ -137,3 +137,23 @@ defmodule MyApp.Accounts.User do end ``` + +Ensure you set the `hashed_password` to `allow_nil?` if you are also using the password strategy. + +```elixir +defmodule MyApp.Accounts.User do + # ... + attributes do + # ... + attribute :hashed_password, :string, allow_nil?: true, sensitive?: true + end + # ... +end +``` + +And generate and run migrations in that case. + +```bash +mix ash.codegen make_hashed_password_nullable +mix ash.migrate +``` diff --git a/documentation/tutorials/google.md b/documentation/tutorials/google.md index 6cf9cf3..349b78b 100644 --- a/documentation/tutorials/google.md +++ b/documentation/tutorials/google.md @@ -7,6 +7,7 @@ First you'll need a registered application in [Google Cloud](https://console.clo 1. On the Cloud's console **Quick access** section select **APIs & Services**, then **Credentials** 2. Click on **+ CREATE CREDENTIALS** and from the dropdown select **OAuth client ID** 3. From the google developers console, we will need: `client_id` & `client_secret` +4. Enter your callback uri under **Authorized redirect URIs**. E.g. `http://localhost:4000/auth/user/google/callback`. Next we configure our resource to use google credentials: @@ -47,7 +48,7 @@ defmodule MyApp.Accounts.User do argument :user_info, :map, allow_nil?: false argument :oauth_tokens, :map, allow_nil?: false upsert? true - upsert_identity :email + upsert_identity :unique_email change AshAuthentication.GenerateTokenChange @@ -66,3 +67,23 @@ defmodule MyApp.Accounts.User do end ``` + +Ensure you set the `hashed_password` to `allow_nil?` if you are also using the password strategy. + +```elixir +defmodule MyApp.Accounts.User do + # ... + attributes do + # ... + attribute :hashed_password, :string, allow_nil?: true, sensitive?: true + end + # ... +end +``` + +And generate and run migrations in that case. + +```bash +mix ash.codegen make_hashed_password_nullable +mix ash.migrate +```