Exemplo n.º 1
0
func testRequest(ab *authboss.Authboss, method string, postFormValues ...string) (*authboss.Context, *httptest.ResponseRecorder, *http.Request, authboss.ClientStorerErr) {
	sessionStorer := mocks.NewMockClientStorer()
	ctx := ab.NewContext()
	r := mocks.MockRequest(method, postFormValues...)
	ctx.SessionStorer = sessionStorer

	return ctx, httptest.NewRecorder(), r, sessionStorer
}
Exemplo n.º 2
0
func Test_verifyToken_MissingToken(t *testing.T) {
	t.Parallel()

	testSetup()
	r := mocks.MockRequest("GET")

	if _, err := verifyToken(nil, r); err == nil {
		t.Error("Expected error about missing token")
	}
}