Skip to content

Commit

Permalink
Merge pull request #542 from RussGan/dev/oauth_delete_adjust
Browse files Browse the repository at this point in the history
🎨调整oauth授权删除逻辑
  • Loading branch information
Lingghh authored Aug 18, 2022
2 parents 1da3910 + a1b19b6 commit c13f1d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/projects/main/apps/authen/apis/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,12 @@ def get(self, request):
return Response(result)

def delete(self, request):
scm_platform_name = request.data.get("scm_platform_name", None)
scm_platform_name = request.data.get("scm_platform_name")
if not scm_platform_name:
scm_platform_name = scm.SCM_PLATFORM_NUM_AS_KEY[scm.ScmPlatformEnum.GIT_OA]
scm_auth_info = ScmAuthManager.get_scm_auth(user=request.user, scm_platform=scm_platform_name)
if scm_auth_info:
scm_auth_info.gitoa_access_token = None
scm_auth_info.gitoa_refresh_token = None
scm_auth_info.save()
scm_auth_info.delete()
return Response(status=status.HTTP_204_NO_CONTENT)


Expand Down

0 comments on commit c13f1d9

Please sign in to comment.