(t *testing.T)
| 248 | } |
| 249 | |
| 250 | func TestUserSessionToken(t *testing.T) { |
| 251 | client, _ := newClient(t) |
| 252 | tokenString, err := client.CreateUserToken("user") |
| 253 | require.NoError(t, err) |
| 254 | assert.Equal(t, tokenString, "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoidXNlciJ9.0Kiui6HUywyU-C-00E68n1iq_3o7Eh0aE5VGSOc3pU4") |
| 255 | token, err := jwt.Parse(tokenString, func(token *jwt.Token) (any, error) { return []byte("secret"), nil }) |
| 256 | require.NoError(t, err) |
| 257 | assert.Equal(t, true, token.Valid) |
| 258 | assert.Equal(t, token.Claims, jwt.MapClaims{"user_id": "user"}) |
| 259 | } |
| 260 | |
| 261 | func TestUserSessionTokenWithClaims(t *testing.T) { |
| 262 | client, _ := newClient(t) |
nothing calls this directly
no test coverage detected