Files
gin-gonic-prepack/util/util.go
🐙PiperYxzzy 0af09dcc01 Fix signup risk of enumeration to test emails
* Now, if a known email is used, it will still return the same result
* If a known email is used, we will ping the email address to know that
there was a signup attempt
2022-05-01 13:25:09 +02:00

36 lines
495 B
Go

package util
import (
"crypto/rand"
"fmt"
"github.com/google/uuid"
)
func GenerateHmac() []byte {
b := make([]byte, 64)
if _, err := rand.Read(b); err != nil {
panic(err)
}
return b
}
type PrincipalInfo struct {
Uid uuid.UUID
Role string
}
type FailMsg struct {
Reason string `json:"reason"`
}
type NextMsg struct {
Next string `json:"nextaction"`
}
func SendEmail(title string, body string, recipient string) {
//TODO
fmt.Println("Send", title, body, "to", recipient)
}