SendActivationLink function
(ctx *fiber.Ctx)
| 79 | |
| 80 | // SendActivationLink function |
| 81 | func (authEndpoint *AuthEndpoint) SendActivationLink(ctx *fiber.Ctx) error { |
| 82 | var inputMap = make(map[string]interface{}) |
| 83 | ctx.BodyParser(&inputMap) |
| 84 | v := validate.Map(inputMap) |
| 85 | v.StringRule("email", "email|required") |
| 86 | |
| 87 | if !v.Validate() { |
| 88 | return ctx.Status(422).JSON(v.Errors) |
| 89 | } |
| 90 | response, err := emailService.SendActivationEmail(bson.M{"email": inputMap["email"].(string)}) |
| 91 | if err != nil { |
| 92 | return ctx.Status(422).JSON(fiber.Map{ |
| 93 | "message": err.Error(), |
| 94 | }) |
| 95 | } |
| 96 | return ctx.JSON(response) |
| 97 | } |
| 98 | |
| 99 | // Activate function |
| 100 | func (authEndpoint *AuthEndpoint) Activate(ctx *fiber.Ctx) error { |
nothing calls this directly
no test coverage detected