簡體   English   中英

我們如何進行設計驗證並僅將電子郵件鏈接重置為24小時和1次鏈接?

[英]How do we make devise verification and reset email links for only 24 hours and only a 1 time link?

我在后端使用Rails。

這是一個基於研究的問題。 我嘗試搜索,但沒有任何解決方案。

任何幫助都將不勝感激。

提前致謝!!!

首先...您要查找的術語可能是“確認”而不是“驗證”,對嗎? 您是在談論允許用戶確認其電子郵件地址的電子郵件嗎? (並將密碼重設一個)?

在這種情況下,最好的起點是Devise的可confirmable文檔: https : //github.com/plataformatec/devise/blob/master/lib/devise/models/confirmable.rb

似乎有這個:

* confirmation_sent_at - A timestamp when the confirmation_token was generated (not sent)

看起來您可以使用它來確定confirmation_sent_at是否在x.days.ago以及是否...決定隨后如何處理。

您也可能會為密碼重置找到類似的東西。

也許這可以幫助您允許未經確認的訪問

# in Devise Initializer
config.allow_unconfirmed_access_for = 365.days

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM