(ipAddress string)
| 348 | } |
| 349 | |
| 350 | func (f *Factor) CreateChallenge(ipAddress string) *Challenge { |
| 351 | id := uuid.Must(uuid.NewV4()) |
| 352 | challenge := &Challenge{ |
| 353 | ID: id, |
| 354 | FactorID: f.ID, |
| 355 | IPAddress: ipAddress, |
| 356 | } |
| 357 | |
| 358 | return challenge |
| 359 | } |
| 360 | func (f *Factor) WriteChallengeToDatabase(tx *storage.Connection, challenge *Challenge) error { |
| 361 | if challenge.FactorID != f.ID { |
| 362 | return errors.New("Can only write challenges that you own") |
no outgoing calls