1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

feat(wip): implement stripe webhooks

This commit is contained in:
Ferdinand Mütsch
2022-12-22 22:43:41 +01:00
parent 05ea05cdf4
commit 0e83ab02fa
4 changed files with 63 additions and 7 deletions

View File

@ -121,6 +121,10 @@ func (u *User) WakaTimeURL(fallback string) string {
return fallback
}
func (u *User) HasActiveSubscription() bool {
return u.SubscribedUntil != nil && u.SubscribedUntil.T().After(time.Now())
}
func (c *CredentialsReset) IsValid() bool {
return ValidatePassword(c.PasswordNew) &&
c.PasswordNew == c.PasswordRepeat