Merge pull request #1199 from taigaio/issue/4841-invitation-login-with-plugins
Fix #4841: Use the plugins login for invitationsstable
commit
16e2a634a9
|
@ -205,9 +205,6 @@ class AuthService extends taiga.Service
|
||||||
acceptInvitiationWithNewUser: (data) ->
|
acceptInvitiationWithNewUser: (data) ->
|
||||||
return @.register(data, "private", false)
|
return @.register(data, "private", false)
|
||||||
|
|
||||||
acceptInvitiationWithExistingUser: (data) ->
|
|
||||||
return @.register(data, "private", true)
|
|
||||||
|
|
||||||
forgotPassword: (data) ->
|
forgotPassword: (data) ->
|
||||||
url = @urls.resolve("users-password-recovery")
|
url = @urls.resolve("users-password-recovery")
|
||||||
data = _.clone(data, false)
|
data = _.clone(data, false)
|
||||||
|
@ -478,7 +475,7 @@ module.directive("tgChangePasswordFromRecovery", ["$tgAuth", "$tgConfirm", "$tgL
|
||||||
## Invitation
|
## Invitation
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics, $translate, config) ->
|
InvitationDirective = ($auth, $confirm, $location, $config, $params, $navUrls, $analytics, $translate, config) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
token = $params.token
|
token = $params.token
|
||||||
|
|
||||||
|
@ -515,7 +512,14 @@ InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics
|
||||||
if not loginForm.validate()
|
if not loginForm.validate()
|
||||||
return
|
return
|
||||||
|
|
||||||
promise = $auth.acceptInvitiationWithExistingUser($scope.dataLogin)
|
loginFormType = $config.get("loginFormType", "normal")
|
||||||
|
data = $scope.dataLogin
|
||||||
|
|
||||||
|
promise = $auth.login({
|
||||||
|
username: data.username,
|
||||||
|
password: data.password,
|
||||||
|
invitation_token: data.token
|
||||||
|
}, loginFormType)
|
||||||
promise.then(onSuccessSubmitLogin, onErrorSubmitLogin)
|
promise.then(onSuccessSubmitLogin, onErrorSubmitLogin)
|
||||||
|
|
||||||
$el.on "submit", "form.login-form", submitLogin
|
$el.on "submit", "form.login-form", submitLogin
|
||||||
|
@ -555,7 +559,7 @@ InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$routeParams",
|
module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$tgConfig", "$routeParams",
|
||||||
"$tgNavUrls", "$tgAnalytics", "$translate", "$tgConfig", InvitationDirective])
|
"$tgNavUrls", "$tgAnalytics", "$translate", "$tgConfig", InvitationDirective])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue