From b963f83c6a09da1eaf02eb9f269c6f5881a0c711 Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 16 Aug 2017 23:37:37 +0200 Subject: Update mattermost vendor (3.7 => 4.1) --- .../mattermost/platform/model/password_recovery.go | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 vendor/github.com/mattermost/platform/model/password_recovery.go (limited to 'vendor/github.com/mattermost/platform/model/password_recovery.go') diff --git a/vendor/github.com/mattermost/platform/model/password_recovery.go b/vendor/github.com/mattermost/platform/model/password_recovery.go deleted file mode 100644 index 303d4a12..00000000 --- a/vendor/github.com/mattermost/platform/model/password_recovery.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -const ( - PASSWORD_RECOVERY_CODE_SIZE = 128 - PASSWORD_RECOVER_EXPIRY_TIME = 1000 * 60 * 60 // 1 hour -) - -type PasswordRecovery struct { - UserId string - Code string - CreateAt int64 -} - -func (p *PasswordRecovery) IsValid() *AppError { - - if len(p.UserId) != 26 { - return NewLocAppError("User.IsValid", "model.password_recovery.is_valid.user_id.app_error", nil, "") - } - - if len(p.Code) != PASSWORD_RECOVERY_CODE_SIZE { - return NewLocAppError("User.IsValid", "model.password_recovery.is_valid.code.app_error", nil, "") - } - - if p.CreateAt == 0 { - return NewLocAppError("User.IsValid", "model.password_recovery.is_valid.create_at.app_error", nil, "") - } - - return nil -} - -func (p *PasswordRecovery) PreSave() { - p.Code = NewRandomString(PASSWORD_RECOVERY_CODE_SIZE) - p.CreateAt = GetMillis() -} -- cgit v1.2.3