mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-12-27 09:56:12 +00:00
fixed token registration
This commit is contained in:
parent
3c5943bef4
commit
4a80491eb7
|
@ -980,12 +980,9 @@ func (a *UserInternalAPI) PerformSaveThreePIDAssociation(ctx context.Context, re
|
|||
const pushRulesAccountDataType = "m.push_rules"
|
||||
|
||||
func (a *UserInternalAPI) ValidateRegistrationToken(ctx context.Context, token string) (*clientapi.RegistrationToken, error) {
|
||||
registrationToken, err := a.DB.GetRegistrationToken(ctx, token)
|
||||
registrationToken, _ := a.DB.GetRegistrationToken(ctx, token)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if registrationToken == nil || *registrationToken.UsesAllowed == 0 || *registrationToken.ExpiryTime > int64(spec.AsTimestamp(time.Now())) {
|
||||
if registrationToken == nil || *registrationToken.UsesAllowed == 0 || *registrationToken.ExpiryTime < int64(spec.AsTimestamp(time.Now())) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue