refactor auth pkg into libraries

This commit is contained in:
dhax 2017-10-31 19:10:09 +01:00
parent 521f081ba0
commit aaf0a0928d
26 changed files with 592 additions and 504 deletions

18
auth/pwdless/chores.go Normal file
View file

@ -0,0 +1,18 @@
package pwdless
import (
"time"
"github.com/dhax/go-base/logging"
)
func (rs *Resource) choresTicker() {
ticker := time.NewTicker(time.Hour * 1)
go func() {
for range ticker.C {
if err := rs.Store.PurgeExpiredToken(); err != nil {
logging.Logger.WithField("chore", "purgeExpiredToken").Error(err)
}
}
}()
}