(tx *storage.Connection, authCode string)
| 145 | } |
| 146 | |
| 147 | func FindFlowStateByAuthCode(tx *storage.Connection, authCode string) (*FlowState, error) { |
| 148 | obj := &FlowState{} |
| 149 | if err := tx.Eager().Q().Where("auth_code = ?", authCode).First(obj); err != nil { |
| 150 | if errors.Cause(err) == sql.ErrNoRows { |
| 151 | return nil, FlowStateNotFoundError{} |
| 152 | } |
| 153 | return nil, errors.Wrap(err, "error finding flow state") |
| 154 | } |
| 155 | |
| 156 | return obj, nil |
| 157 | } |
| 158 | |
| 159 | func FindFlowStateByID(tx *storage.Connection, id string) (*FlowState, error) { |
| 160 | obj := &FlowState{} |