mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix issue 25390 (#25403)
This commit is contained in:
@@ -1198,6 +1198,15 @@ type API interface {
|
||||
//
|
||||
// Minimum server version: 9.0
|
||||
SendPushNotification(notification *model.PushNotification, userID string) *model.AppError
|
||||
|
||||
// UpdateUserAuth updates a user's auth data.
|
||||
//
|
||||
// It is not currently possible to use this to set a user's auth to e-mail with a hashed
|
||||
// password. It is meant to be used exclusively in setting a non-email auth service.
|
||||
//
|
||||
// @tag User
|
||||
// Minimum server version: 9.3
|
||||
UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
|
||||
}
|
||||
|
||||
var handshake = plugin.HandshakeConfig{
|
||||
|
||||
@@ -1280,3 +1280,10 @@ func (api *apiTimerLayer) SendPushNotification(notification *model.PushNotificat
|
||||
api.recordTime(startTime, "SendPushNotification", _returnsA == nil)
|
||||
return _returnsA
|
||||
}
|
||||
|
||||
func (api *apiTimerLayer) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
||||
startTime := timePkg.Now()
|
||||
_returnsA, _returnsB := api.apiImpl.UpdateUserAuth(userID, userAuth)
|
||||
api.recordTime(startTime, "UpdateUserAuth", _returnsB == nil)
|
||||
return _returnsA, _returnsB
|
||||
}
|
||||
|
||||
@@ -5996,3 +5996,33 @@ func (s *apiRPCServer) SendPushNotification(args *Z_SendPushNotificationArgs, re
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Z_UpdateUserAuthArgs struct {
|
||||
A string
|
||||
B *model.UserAuth
|
||||
}
|
||||
|
||||
type Z_UpdateUserAuthReturns struct {
|
||||
A *model.UserAuth
|
||||
B *model.AppError
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
||||
_args := &Z_UpdateUserAuthArgs{userID, userAuth}
|
||||
_returns := &Z_UpdateUserAuthReturns{}
|
||||
if err := g.client.Call("Plugin.UpdateUserAuth", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to UpdateUserAuth API failed: %s", err.Error())
|
||||
}
|
||||
return _returns.A, _returns.B
|
||||
}
|
||||
|
||||
func (s *apiRPCServer) UpdateUserAuth(args *Z_UpdateUserAuthArgs, returns *Z_UpdateUserAuthReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.UpdateUserAuth(args.A, args.B)
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("API UpdateUserAuth called but not implemented."))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4099,6 +4099,34 @@ func (_m *API) UpdateUserActive(userID string, active bool) *model.AppError {
|
||||
return r0
|
||||
}
|
||||
|
||||
// UpdateUserAuth provides a mock function with given fields: userID, userAuth
|
||||
func (_m *API) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
||||
ret := _m.Called(userID, userAuth)
|
||||
|
||||
var r0 *model.UserAuth
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, *model.UserAuth) (*model.UserAuth, *model.AppError)); ok {
|
||||
return rf(userID, userAuth)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, *model.UserAuth) *model.UserAuth); ok {
|
||||
r0 = rf(userID, userAuth)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.UserAuth)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, *model.UserAuth) *model.AppError); ok {
|
||||
r1 = rf(userID, userAuth)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateUserCustomStatus provides a mock function with given fields: userID, customStatus
|
||||
func (_m *API) UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError {
|
||||
ret := _m.Called(userID, customStatus)
|
||||
|
||||
Reference in New Issue
Block a user