On Mon, Sep 21, 2020 at 9:15 AM Pradyum Gupta <prady...@gmail.com> wrote:

> am looking for some advice/Mentorship.
>
> wanted to create an *invitation link for onboarding user to a company* 
> similarly
> slack does by sending company employees email so that they could directly
> join the company but using the Django rest framework is there any method
> that you can refer?
>
> see things that I have in my mind coming is that I can put company_id in
> hash inside a link and then when a user will come with that hash I can
> compare it and onboard the user.
>
but in that case, there is no link_time_age I can compare!
>
You can generate a hash and store a timestamp in the model (Django model),
then code the logic you are referring in the view (you get the model
instance through the hash)

> is there any method or any crypto algo in which is can convert
> company_UUID into some string and decode back into UUID and then compare it
> through icontains
>
There is, see Django's PasswordResetView - although you may not need it

> and similarly I can do with time and age of link?
>
IMO, it would be easier for you to store that in a model and write the
logic than encapsulate all the info in a hash

> but first of all, is this the right approach?
>
Both get the job done, both have their own advantages, is up to you to
decide in terms of benefits and costs (i.e. complexity)

> or how do people in a company like slack or telegram do?
>
I don't know if people working there can answer that (at least shortly:
https://whimsical.com/P53PjXCBWEi2fdMjP2Hti)

> any kind of help will be really appreciated.
>
> See what am looking for certain guidance or any reference documentation.
>
https://docs.djangoproject.com/en/3.1/topics/auth/default/#django.contrib.auth.views.PasswordResetView
https://github.com/django/django/blob/master/django/contrib/auth/views.py#L189

Hope that helps getting your way through it

> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-rest-framework+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-rest-framework/5cec683f-45d8-4259-a992-0a20f2f3053an%40googlegroups.com
> <https://groups.google.com/d/msgid/django-rest-framework/5cec683f-45d8-4259-a992-0a20f2f3053an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/CA%2BFDnhLpNarCiO2H-BxwC5VsPSXqtd72sxSem8b-zCxAOfvUbQ%40mail.gmail.com.

Reply via email to