refactor auth pkg into libraries
This commit is contained in:
parent
521f081ba0
commit
aaf0a0928d
26 changed files with 592 additions and 504 deletions
18
auth/pwdless/chores.go
Normal file
18
auth/pwdless/chores.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue