MCPcopy Create free account
hub / github.com/netlify/gotrue / assertAuthorizationFailure

Function assertAuthorizationFailure

api/external_test.go:123–139  ·  view source on GitHub ↗
(ts *ExternalTestSuite, u *url.URL, errorDescription string, errorType string, email string)

Source from the content-addressed store, hash-verified

121}
122
123func assertAuthorizationFailure(ts *ExternalTestSuite, u *url.URL, errorDescription string, errorType string, email string) {
124 // ensure new sign ups error
125 v, err := url.ParseQuery(u.Fragment)
126 ts.Require().NoError(err)
127 ts.Require().Equal(errorDescription, v.Get("error_description"))
128 ts.Require().Equal(errorType, v.Get("error"))
129
130 ts.Empty(v.Get("access_token"))
131 ts.Empty(v.Get("refresh_token"))
132 ts.Empty(v.Get("expires_in"))
133 ts.Empty(v.Get("token_type"))
134
135 // ensure user is nil
136 user, err := models.FindUserByEmailAndAudience(ts.API.db, ts.instanceID, email, ts.Config.JWT.Aud)
137 ts.Require().Error(err, "User not found")
138 ts.Require().Nil(user)
139}
140
141// TestSignupExternalUnsupported tests API /authorize for an unsupported external provider
142func (ts *ExternalTestSuite) TestSignupExternalUnsupported() {

Calls 3

GetMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…