Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Deactivate user endpoint on Connect #356

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pxwxnvermx
Copy link
Contributor

@pxwxnvermx pxwxnvermx changed the title Implement Suspend user endpoint on Connect Implement Deactivate user endpoint on Connect Jul 9, 2024
@csrf_exempt
@api_view(["POST"])
@authentication_classes([OAuth2Authentication])
def user_deactivate(request):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is mobile supposed to call this or does connectid do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is called by mobile.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be safer and better if this were called by connectid. That way we don't need to rely on mobile, and as soon as a user account is deactivated we can be sure no new data will flow in

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. We need to think about the Authentication between Connect and ConnectID for making requests to this API.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sravan made a good point against this on the spec. Let's chat about this offline and make a decision

@@ -21,4 +22,5 @@
path("accept_invite/<slug:invite_id>/", view=accept_invite, name="accept_invite"),
path("demo_users/", view=demo_user_tokens, name="demo_users"),
path("sms_status_callback/", SMSStatusCallbackView.as_view(), name="sms_status_callback"),
path("user_suspend/", user_deactivate, name="user_suspend"),
Copy link
Member

@sravfeyn sravfeyn Jul 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit user_suspend -> suspend_user. user_deactivate -> deactivate_user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 48a2069

@csrf_exempt
@api_view(["POST"])
@authentication_classes([OAuth2Authentication])
def deactivate_user(request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a good practice to add a small note here as to where this is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants