Add hot reload for backend
All checks were successful
Build Backend (NixCN CMS) TeamCity build finished
Build Frontend (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-01 20:22:55 +08:00
parent 83fe326962
commit 3d685b5a86
10 changed files with 46 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
package magiclink
package authcode
import (
"crypto/rand"
@@ -19,7 +19,7 @@ var (
)
// Generate magic token
func NewMagicToken(email string) (string, error) {
func NewAuthCode(email string) (string, error) {
b := make([]byte, 32)
if _, err := rand.Read(b); err != nil {
return "", err
@@ -36,7 +36,7 @@ func NewMagicToken(email string) (string, error) {
}
// Verify magic token
func VerifyMagicToken(token string) (string, bool) {
func VerifyAuthCode(token string) (string, bool) {
val, ok := store.Load(token)
if !ok {
return "", false