# お客様作成→パスワード再設定時のレコードの挙動 ###### tags: `調査` ## 再設定前のレコード  ```sql= id | email | encrypted_password | reset_password_token | reset_password_sent_at | remember_created_at | confirmation_token | confirmed_at | confirmation_sent_at | unconfirmed_email | created_at | updated_at | provider | uid | allow_password_change | name | tokens | dec_password | type | plan_term_month | plan_begins_on | plan_id | reset_token | company_name | first_name | first_name_kana | last_name | last_name_kana ----+-----------------+--------------------+----------------------+------------------------+---------------------+--------------------+--------------+----------------------+-------------------+----------------------------+----------------------------+----------+-----------------+-----------------------+------+--------+--------------+----------+-----------------+----------------+---------+----------------------------------+--------------+------------+-----------------+-----------+---------------- 24 | test@gasdga.com | | | | | | | | | 2020-12-04 00:30:41.889301 | 2020-12-04 00:30:41.897076 | email | test@gasdga.com | f | 坂本 | | | Customer | | | 2 | 24457bcb1539ff6ba6a81e7c60e69763 | test | | | | ``` ### 再設定後のレコード ```sql= id | email | encrypted_password | reset_password_token | reset_password_sent_at | remember_created_at | confirmation_token | confirmed_at | confirmation_sent_at | unconfirmed_email | created_at | updated_at | provider | uid | allow_password_change | name | tokens | dec_password | type | plan_term_month | plan_begins_on | plan_id | reset_token | company_name | first_name | first_name_kana | last_name | last_name_kana ----+-----------------+--------------------------------------------------------------+----------------------+------------------------+---------------------+--------------------+--------------+----------------------+-------------------+----------------------------+----------------------------+----------+-----------------+-----------------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+----------+-----------------+----------------+---------+-------------+--------------+------------+-----------------+-----------+---------------- 24 | test@gasdga.com | $2a$11$a27yThnX0XpxQFxQx/bCR.OERgteVBUG1At0UL9//gR4eBFD0gxZa | | | | | | | | 2020-12-04 00:30:41.889301 | 2020-12-04 00:50:17.631329 | email | test@gasdga.com | f | 坂本 | "{\"dU61Q3C8QF6lGMXODTs19A\":{\"token\":\"$2a$10$BTr5ccXlBZT7eR6kSGvZKuHUv90f/wNWE0Ej7KKMwhYjro4Pv7ezi\",\"expiry\":1608252616,\"updated_at\":\"2020-12-04 00:50:17 UTC\"}}" | | Customer | | | 2 | | test | | | | ``` ### メモ 変わること 1. encrypted_password、tokensが作成される 2. reset_tokenが削除される reset_tokenを使用して、新規トークンと暗号化されたパスワードが再設定されるぽい そして再設定を2回目されたら困るのでreset_tokenを消すみたい。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up