-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The login method validation technically fails for SSO (which means us lol). We can trust that login source better than other 3p auth providers so don't validate login method there.
- Loading branch information
1 parent
6f1ef89
commit 12db5e2
Showing
2 changed files
with
13 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,7 +514,7 @@ defmodule Core.Services.UsersTest do | |
end | ||
end | ||
|
||
describe "#bootstrap_users/2" do | ||
describe "#bootstrap_user/2" do | ||
test "it will create new users and set login method" do | ||
{:ok, user} = Users.bootstrap_user(:google, %{email: "[email protected]", name: "New User"}) | ||
|
||
|
@@ -532,11 +532,19 @@ defmodule Core.Services.UsersTest do | |
assert upd.login_method == :google | ||
end | ||
|
||
test "it will not allow logins w/o login method set" do | ||
test "it will not allow logins w/o correct login method set" do | ||
user = insert(:user) | ||
|
||
{:error, _} = Users.bootstrap_user(:google, %{email: user.email}) | ||
end | ||
|
||
test "it will allow sso logins w/ whatever login method set" do | ||
user = insert(:user) | ||
|
||
{:ok, upd} = Users.bootstrap_user(:sso, %{email: user.email}) | ||
|
||
assert upd.id == user.id | ||
end | ||
end | ||
|
||
describe "#create_trust_relationship" do | ||
|