Files
a9213fd24a Magic link (passwordless) authentication for guests (#34264)
* Add EasyLogin configuration (#34217)

* add easy login config

* add easy login to the invite modal

* add to the query parameters

* Add an API to get login method for the login id (#34223)

* add an api to get login method for the login id

* do not return errors if user is not found

* Add support for Easy Login invitation link sending (#34224)

This generates Easy Login token types when requested. The server
doesn't do anything with these tokens, yet - that will come in a
future change.

* Add support for logging in with easy login (#34236)

* Fix E2E tests (#34240)

* Prevent easy login accounts to reset their password (#34262)

* Add easy login support to login api and limit token to 5 min (#34259)

* webapp easy login ui mods (#34237)

* webapp easy login ui mods
* easy login i18n
* lint issues
* getUserLoginType
* using the real API
* easylogin proper redirect
* remove unneeded functions and files
* duplicated localization
* remove easylogin
* using EnableEasyLogin setting
* localization fix
* fix lint issue
* remove excessive setIsWaiting
* changed logic to make it more readable
* renaming component to make easier editable
* password will disappear when username change
* login test
* text for easy login password

* Add app links to emails

* Update templates and always land in the landing screen

* Update svg image, improve checks on server, fix linking page and show deactivated on login type

* Update naming

* Fix mocks and imports

* Remove all sessions on disable and forbid user promotion

* Fix layer and tests

* Address feedback

* Fix tests

* Fix missing string

* Fix texts

* Fix tests

* Fix constant name

* Fix tests

* Fix test

* Address feedback

* Fix lint

* Fix test

* Address feedback

* Fix test

---------

Co-authored-by: Ibrahim Serdar Acikgoz <[email protected]>
Co-authored-by: David Krauser <[email protected]>
Co-authored-by: Daniel Espino <[email protected]>
Co-authored-by: Mattermost Build <[email protected]>
2025-11-20 14:06:23 +01:00

209 lines
4.7 KiB
Go

// Code generated by mockery v2.53.4. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
package mocks
import (
model "github.com/mattermost/mattermost/server/public/model"
mock "github.com/stretchr/testify/mock"
)
// TokenStore is an autogenerated mock type for the TokenStore type
type TokenStore struct {
mock.Mock
}
// Cleanup provides a mock function with given fields: expiryTime
func (_m *TokenStore) Cleanup(expiryTime int64) {
_m.Called(expiryTime)
}
// ConsumeOnce provides a mock function with given fields: tokenType, tokenStr
func (_m *TokenStore) ConsumeOnce(tokenType string, tokenStr string) (*model.Token, error) {
ret := _m.Called(tokenType, tokenStr)
if len(ret) == 0 {
panic("no return value specified for ConsumeOnce")
}
var r0 *model.Token
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (*model.Token, error)); ok {
return rf(tokenType, tokenStr)
}
if rf, ok := ret.Get(0).(func(string, string) *model.Token); ok {
r0 = rf(tokenType, tokenStr)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Token)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(tokenType, tokenStr)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: token
func (_m *TokenStore) Delete(token string) error {
ret := _m.Called(token)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(token)
} else {
r0 = ret.Error(0)
}
return r0
}
// GetAllTokensByType provides a mock function with given fields: tokenType
func (_m *TokenStore) GetAllTokensByType(tokenType string) ([]*model.Token, error) {
ret := _m.Called(tokenType)
if len(ret) == 0 {
panic("no return value specified for GetAllTokensByType")
}
var r0 []*model.Token
var r1 error
if rf, ok := ret.Get(0).(func(string) ([]*model.Token, error)); ok {
return rf(tokenType)
}
if rf, ok := ret.Get(0).(func(string) []*model.Token); ok {
r0 = rf(tokenType)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Token)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(tokenType)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetByToken provides a mock function with given fields: token
func (_m *TokenStore) GetByToken(token string) (*model.Token, error) {
ret := _m.Called(token)
if len(ret) == 0 {
panic("no return value specified for GetByToken")
}
var r0 *model.Token
var r1 error
if rf, ok := ret.Get(0).(func(string) (*model.Token, error)); ok {
return rf(token)
}
if rf, ok := ret.Get(0).(func(string) *model.Token); ok {
r0 = rf(token)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Token)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(token)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetTokenByTypeAndEmail provides a mock function with given fields: tokenType, email
func (_m *TokenStore) GetTokenByTypeAndEmail(tokenType string, email string) (*model.Token, error) {
ret := _m.Called(tokenType, email)
if len(ret) == 0 {
panic("no return value specified for GetTokenByTypeAndEmail")
}
var r0 *model.Token
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (*model.Token, error)); ok {
return rf(tokenType, email)
}
if rf, ok := ret.Get(0).(func(string, string) *model.Token); ok {
r0 = rf(tokenType, email)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Token)
}
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(tokenType, email)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// RemoveAllTokensByType provides a mock function with given fields: tokenType
func (_m *TokenStore) RemoveAllTokensByType(tokenType string) error {
ret := _m.Called(tokenType)
if len(ret) == 0 {
panic("no return value specified for RemoveAllTokensByType")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(tokenType)
} else {
r0 = ret.Error(0)
}
return r0
}
// Save provides a mock function with given fields: recovery
func (_m *TokenStore) Save(recovery *model.Token) error {
ret := _m.Called(recovery)
if len(ret) == 0 {
panic("no return value specified for Save")
}
var r0 error
if rf, ok := ret.Get(0).(func(*model.Token) error); ok {
r0 = rf(recovery)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewTokenStore creates a new instance of TokenStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewTokenStore(t interface {
mock.TestingT
Cleanup(func())
}) *TokenStore {
mock := &TokenStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}