/
wax_boy
/
semaphore_custom
Обзор
Документация
Войти
/
wax_boy
/
semaphore_custom
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
db/Session.go
32 строки
913 B
Denis Gukov
email verification (#3008)
07 май 2025, 15:28
Не верифицирован
07 май 2025, 15:28
faabcb3
Код
Авторство
О чём код?
package db import "time" type SessionVerificationMethod int const ( SessionVerificationNone SessionVerificationMethod = iota SessionVerificationTotp SessionVerificationEmail ) // Session is a connection to the API type Session struct { ID int `db:"id" json:"id"` UserID int `db:"user_id" json:"user_id"` Created time.Time `db:"created" json:"created"` LastActive time.Time `db:"last_active" json:"last_active"` IP string `db:"ip" json:"ip"` UserAgent string `db:"user_agent" json:"user_agent"` Expired bool `db:"expired" json:"expired"` VerificationMethod SessionVerificationMethod `db:"verification_method" json:"verification_method"` Verified bool `db:"verified" json:"verified"` } func (s *Session) IsVerified() bool { if s.VerificationMethod == SessionVerificationNone { return true } return s.Verified }