You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -80,15 +75,24 @@ func (h *LoginHelper) ForceRefresh(t *testing.T, db database.Store, user *coders
80
75
LoginType: database.LoginTypeOIDC,
81
76
})
82
77
require.NoError(t, err, "expire user link")
78
+
79
+
returnlink.OAuthRefreshToken
80
+
}
81
+
82
+
// ForceRefresh forces the client to refresh its oauth token.
83
+
func (h*LoginHelper) ForceRefresh(t*testing.T, db database.Store, user*codersdk.Client, idToken jwt.MapClaims) {
84
+
t.Helper()
85
+
86
+
refreshToken:=h.ExpireOauthToken(t, db, user)
87
+
// Updates the claims that the IDP will return. By default, it always
88
+
// uses the original claims for the original oauth token.
89
+
h.fake.UpdateRefreshClaims(refreshToken, idToken)
90
+
83
91
t.Cleanup(func() {
84
-
require.True(t, h.fake.RefreshUsed(link.OAuthRefreshToken), "refresh token must be used, but has not. Did you forget to call the returned function from this call?")
92
+
require.True(t, h.fake.RefreshUsed(refreshToken), "refresh token must be used, but has not. Did you forget to call the returned function from this call?")
0 commit comments