Feat/multiple session (#64)

* fix: disable windows build

* feat: add ability to handle multiple sessions
This commit is contained in:
Lakhan Samani
2021-10-27 23:15:38 +05:30
committed by GitHub
parent 4649391169
commit b69d0b8e23
21 changed files with 301 additions and 53 deletions

View File

@@ -27,6 +27,7 @@ type Manager interface {
GetVerificationByEmail(email string) (VerificationRequest, error)
DeleteUser(email string) error
SaveRoles(roles []Role) error
SaveSession(session Session) error
}
type manager struct {
@@ -56,7 +57,7 @@ func InitDB() {
if err != nil {
log.Fatal("Failed to init db:", err)
} else {
db.AutoMigrate(&User{}, &VerificationRequest{}, &Role{})
db.AutoMigrate(&User{}, &VerificationRequest{}, &Role{}, &Session{})
}
Mgr = &manager{db: db}