学習記録
2020-04-20に投稿

Railsチュートリアルの勉強中。

9.1.2 ログイン状態の保持

下記が==演算子を再定義している箇所だと思われる。
https://github.com/codahale/bcrypt-ruby/blob/master/lib/bcrypt/password.rb#L64

    # Compares a potential secret against the hash. Returns true if the secret is the original secret, false otherwise.
    def ==(secret)
      super(BCrypt::Engine.hash_secret(secret, @salt))
    end
    alias_method :is_password?, :==

dychw
学習記録
所有者限定モードのためこのボードには投稿できません
コメント
学習記録