예제 #1
0
    def send_instant_login_link(self):
        token = str(uuid.uuid4())
        self.token = make_password(token)
        self.save()

        path = reverse("hc-check-token", args=[self.user.username, token])
        ctx = {"login_link": settings.SITE_ROOT + path}
        emails.login(self.user.email, ctx)
예제 #2
0
    def send_instant_login_link(self):
        token = str(uuid.uuid4())
        self.token = make_password(token)
        self.save()

        path = reverse("hc-check-token", args=[self.user.username, token])
        ctx = {"login_link": settings.SITE_ROOT + path}
        emails.login(self.user.email, ctx)
예제 #3
0
 def send_instant_login_link(self, inviting_profile=None):
     token = self.prepare_token("login")
     path = reverse("hc-check-token", args=[self.user.username, token])
     ctx = {
         "button_text": "Log In",
         "button_url": settings.SITE_ROOT + path,
         "inviting_profile": inviting_profile
     }
     emails.login(self.user.email, ctx)
예제 #4
0
 def send_instant_login_link(self, inviting_profile=None):
     token = self.prepare_token("login")
     path = reverse("hc-check-token", args=[self.user.username, token])
     ctx = {
         "button_text": "Log In",
         "button_url": settings.SITE_ROOT + path,
         "inviting_profile": inviting_profile
     }
     emails.login(self.user.email, ctx)
예제 #5
0
def _send_login_link(user):
    token = str(uuid.uuid4())
    user.set_password(token)
    user.save()

    login_link = reverse("hc-check-token", args=[user.username, token])
    login_link = settings.SITE_ROOT + login_link
    ctx = {"login_link": login_link}

    emails.login(user.email, ctx)
예제 #6
0
def _send_login_link(user):
    token = str(uuid.uuid4())
    user.set_password(token)
    user.save()

    login_link = reverse("hc-check-token", args=[user.username, token])
    login_link = settings.SITE_ROOT + login_link
    ctx = {"login_link": login_link}

    emails.login(user.email, ctx)
예제 #7
0
    def send_instant_login_link(self, inviting_profile=None):
        token = str(uuid.uuid4())
        self.token = make_password(token)
        self.save()

        path = reverse("hc-check-token", args=[self.user.username, token])
        ctx = {
            "button_text": "Log In",
            "button_url": settings.SITE_ROOT + path,
            "inviting_profile": inviting_profile
        }
        emails.login(self.user.email, ctx)
예제 #8
0
    def send_instant_login_link(self, inviting_project=None, redirect_url=None):
        token = self.prepare_token("login")
        path = reverse("hc-check-token", args=[self.user.username, token])
        if redirect_url:
            path += "?next=%s" % redirect_url

        ctx = {
            "button_text": "Sign In",
            "button_url": settings.SITE_ROOT + path,
            "inviting_project": inviting_project,
        }
        emails.login(self.user.email, ctx)
예제 #9
0
    def send_change_email_link(self, new_email):
        payload = {
            "u": self.user.username,
            "t": self.prepare_token(),
            "e": new_email,
        }
        signed_payload = TimestampSigner().sign_object(payload)
        path = reverse("hc-change-email-verify", args=[signed_payload])

        ctx = {
            "button_text": "Sign In",
            "button_url": settings.SITE_ROOT + path,
        }
        emails.login(new_email, ctx)