linstrom/auth-new/auth.go
2025-03-31 08:07:16 +02:00

23 lines
653 B
Go

// Package auth is responsible for everything authentication
//
// Be that checking login data and handing out an access token on sucess,
// checking if a given access token can do the requested action
// or adding or updating the authentication information of an account.
// And I probably forgot something
package auth
import (
"time"
"github.com/go-webauthn/webauthn/webauthn"
)
type Authenticator struct {
webauthn *webauthn.WebAuthn
}
func calcAccessExpirationTimestamp() time.Time {
// For now, the default expiration is one month after creation
// though "never" might also be a good option
return time.Now().Add(time.Hour * 24 * 30)
}