MCPcopy Create free account
hub / github.com/devinterface/startersaas-go-api / SendActivationLink

Method SendActivationLink

endpoints/auth.endpoint.go:81–97  ·  view source on GitHub ↗

SendActivationLink function

(ctx *fiber.Ctx)

Source from the content-addressed store, hash-verified

79
80// SendActivationLink function
81func (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
100func (authEndpoint *AuthEndpoint) Activate(ctx *fiber.Ctx) error {

Callers

nothing calls this directly

Calls 1

SendActivationEmailMethod · 0.80

Tested by

no test coverage detected