24 lines
586 B
Go
24 lines
586 B
Go
|
package handlers
|
||
|
|
||
|
import (
|
||
|
"code.lila.network/lauralani/tlm-login-server/internal/models"
|
||
|
"github.com/gofiber/fiber/v2"
|
||
|
)
|
||
|
|
||
|
func GETUserEmailConfirm(c *fiber.Ctx) error {
|
||
|
confirmationsecret := c.Query("cs")
|
||
|
|
||
|
if confirmationsecret == "" {
|
||
|
return fiber.NewError(fiber.StatusBadRequest, "400 Bad Request")
|
||
|
}
|
||
|
|
||
|
confirmation := models.EmailConfirmation{ConfirmationCode: confirmationsecret}
|
||
|
|
||
|
models.DB.First(&confirmation)
|
||
|
|
||
|
//fmt.Printf("UserID of Confirmation: %v\n", confirmation.UserID)
|
||
|
//fmt.Printf("Username of Confirmation: %v\n", confirmation.User.Username)
|
||
|
|
||
|
return nil
|
||
|
}
|