-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
passed userContext to the querier functions
- Loading branch information
1 parent
c72f26c
commit 1937c90
Showing
22 changed files
with
164 additions
and
123 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
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
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 |
---|---|---|
|
@@ -55,3 +55,44 @@ func TestNetworkInterceptorDuringSignIn(t *testing.T) { | |
assert.Equal(t, 200, res.StatusCode) | ||
assert.Equal(t, true, isNetworkIntercepted) | ||
} | ||
|
||
func TestNetworkInterceptorNotSet(t *testing.T) { | ||
isNetworkIntercepted = false | ||
configValue := supertokens.TypeInput{ | ||
Supertokens: &supertokens.ConnectionInfo{ | ||
ConnectionURI: "http://localhost:8080", | ||
}, | ||
AppInfo: supertokens.AppInfo{ | ||
AppName: "SuperTokens", | ||
APIDomain: "api.supertokens.io", | ||
WebsiteDomain: "supertokens.io", | ||
}, | ||
RecipeList: []supertokens.Recipe{ | ||
Init(nil), | ||
}, | ||
} | ||
BeforeEach() | ||
|
||
unittesting.StartUpST("localhost", "8080") | ||
|
||
defer AfterEach() | ||
|
||
err := supertokens.Init(configValue) | ||
|
||
if err != nil { | ||
t.Error(err.Error()) | ||
} | ||
|
||
mux := http.NewServeMux() | ||
testServer := httptest.NewServer(supertokens.Middleware(mux)) | ||
defer testServer.Close() | ||
|
||
res, err := unittesting.SignInRequest("[email protected]", "validpass123", testServer.URL) | ||
|
||
if err != nil { | ||
t.Error(err.Error()) | ||
} | ||
|
||
assert.Equal(t, 200, res.StatusCode) | ||
assert.Equal(t, false, isNetworkIntercepted) | ||
} |
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
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
Oops, something went wrong.