Store saves OIDC session data for the given state.
(ctx context.Context, state string, data *OidcSessionData, ttl time.Duration)
| 35 | |
| 36 | // Store saves OIDC session data for the given state. |
| 37 | func (s *OidcSessionStore) Store(ctx context.Context, state string, data *OidcSessionData, ttl time.Duration) error { |
| 38 | rdb := s.rdb.RDB(ctx) |
| 39 | if rdb == nil { |
| 40 | return redis.Nil |
| 41 | } |
| 42 | key := hostctx.TenantKey(ctx, oidcSessionPrefix+state) |
| 43 | b, err := json.Marshal(data) |
| 44 | if err != nil { |
| 45 | return err |
| 46 | } |
| 47 | return rdb.Set(ctx, key, b, ttl).Err() |
| 48 | } |
| 49 | |
| 50 | // GetAndDelete retrieves and deletes OIDC session data for the given state. |
| 51 | func (s *OidcSessionStore) GetAndDelete(ctx context.Context, state string) (*OidcSessionData, error) { |
no test coverage detected