Simplify oauth (#8972)
* Remove unused OauthProvider::GetIdentifier Signed-off-by: Emil Velikov <emil.velikov@collabora.com> * Reuse gitlab's getAuthData() instead of open-coding it Signed-off-by: Emil Velikov <emil.velikov@collabora.com> * Remove OauthProvider::GetAuthDataFromJson interface The data is already available via GetUserFromJson().AuthData Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
85aa3d664c
Коммит
f17c15c9d8
@@ -457,7 +457,13 @@ func (a *App) LoginByOAuth(service string, userData io.Reader, teamId string) (*
|
||||
return nil, model.NewAppError("LoginByOAuth", "api.user.login_by_oauth.not_available.app_error",
|
||||
map[string]interface{}{"Service": strings.Title(service)}, "", http.StatusNotImplemented)
|
||||
} else {
|
||||
authData = provider.GetAuthDataFromJson(bytes.NewReader(buf.Bytes()))
|
||||
authUser := provider.GetUserFromJson(bytes.NewReader(buf.Bytes()))
|
||||
|
||||
if authUser.AuthData != nil {
|
||||
authData = *authUser.AuthData
|
||||
} else {
|
||||
authData = ""
|
||||
}
|
||||
}
|
||||
|
||||
if len(authData) == 0 {
|
||||
|
||||
Ссылка в новой задаче
Block a user