(expected ...State)
| 94 | func (s State) LoginWasUsed() bool { return s == FlowStateLoginUsed || s == FlowStateLoginError } |
| 95 | |
| 96 | func (s State) IsAny(expected ...State) error { |
| 97 | for _, e := range expected { |
| 98 | if s == e { |
| 99 | return nil |
| 100 | } |
| 101 | } |
| 102 | return errors.Errorf("invalid flow state: expected one of %v, got %d", expected, s) |
| 103 | } |
| 104 | |
| 105 | // Flow is an abstraction used in the persistence layer to unify LoginRequest, |
| 106 | // HandledLoginRequest, ConsentRequest, and AcceptOAuth2ConsentRequest. |
no test coverage detected