getTargetUser reads the user from the context.
(ctx context.Context)
| 82 | |
| 83 | // getTargetUser reads the user from the context. |
| 84 | func getTargetUser(ctx context.Context) *models.User { |
| 85 | if ctx == nil { |
| 86 | return nil |
| 87 | } |
| 88 | obj := ctx.Value(targetUserKey) |
| 89 | if obj == nil { |
| 90 | return nil |
| 91 | } |
| 92 | return obj.(*models.User) |
| 93 | } |
| 94 | |
| 95 | // getFactor reads the factor id from the context |
| 96 | func getFactor(ctx context.Context) *models.Factor { |
no test coverage detected