MCPcopy Create free account
hub / github.com/supabase/auth / SetupTest

Method SetupTest

internal/api/token_test.go:49–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49func (ts *TokenTestSuite) SetupTest() {
50 ts.RefreshToken = nil
51 models.TruncateAll(ts.API.db)
52
53 // Create user & refresh token
54 u, err := models.NewUser("", "test@example.com", "password", ts.Config.JWT.Aud, nil)
55 require.NoError(ts.T(), err, "Error creating test user model")
56 t := time.Now()
57 u.EmailConfirmedAt = &t
58 u.BannedUntil = nil
59 require.NoError(ts.T(), ts.API.db.Create(u), "Error saving new test user")
60
61 ts.User = u
62 ts.RefreshToken, err = models.GrantAuthenticatedUser(ts.API.db, u, models.GrantParams{})
63 require.NoError(ts.T(), err, "Error creating refresh token")
64 ts.Config.Hook.CustomAccessToken.Enabled = false
65
66}
67
68func (ts *TokenTestSuite) TestSessionTimebox() {
69 timebox := 10 * time.Second

Callers

nothing calls this directly

Calls 4

TruncateAllFunction · 0.92
NewUserFunction · 0.92
GrantAuthenticatedUserFunction · 0.92
NowMethod · 0.80

Tested by

no test coverage detected