Add ability to detach external login services

This commit is contained in:
Joseph Schorr 2014-09-15 12:01:02 -04:00
parent e8ad01cb41
commit 913b3e472f
5 changed files with 62 additions and 1 deletions

View file

@ -408,6 +408,19 @@ class Signout(ApiResource):
return {'success': True}
@resource('/v1/detachexternal/<servicename>')
@internal_only
class DetachExternal(ApiResource):
""" Resource for detaching an external login. """
@require_user_admin
@nickname('detachExternalLogin')
def post(self, servicename):
""" Request that the current user be detached from the external login service. """
model.detach_external_login(get_authenticated_user(), servicename)
return {'success': True}
@resource("/v1/recovery")
@internal_only
class Recovery(ApiResource):