Skip to content
New issue

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

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

Already on GitHub? # to your account

リセットパスワード機能を作成したい #132

Open
subaru-hello opened this issue Feb 3, 2022 · 0 comments
Open

リセットパスワード機能を作成したい #132

subaru-hello opened this issue Feb 3, 2022 · 0 comments
Labels
機能追加 Further information is requested

Comments

@subaru-hello
Copy link
Owner

概要

パスワード再設定機能を実装したい

詳細

sorceryに用意してあるreset_passwordモジュールを使用する。

① パスワード再設定用の案内メールを送信するためのページを追加する。
ログインページにパスワードをお忘れの方はこちらというリンクを追加する。そのリンクをクリックすると、パスワード再設定用の案内メールを送信するためのページへ遷移する。(url は/reset_password/とする。)

### ② sorceryのreset_passwordモジュール を使用する。
パスワード再設定に使用するトークンの有効期限は1時間とする。

user.reset_password_expiration_period = 1.hour
メール内容は下記のように設定する。

件名: パスワード再設定の案内
宛先: 入力されたメールアドレス
差出人: ZEROKEN no_replay@Zeroken.site

本文には以下のURLを設定する
/reset_password/edit?token=<ユーザーのトークン>

③パスワード再設定ページを追加
メール本文にあるリンクをクリックすると、/reset_password/editに遷移する。

新しいパスワードを入力後、更新するをクリックするとログインページへ遷移する。

④sendgridの導入
こちらの記事を参考に導入

@subaru-hello subaru-hello added the 機能追加 Further information is requested label Feb 5, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
機能追加 Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant