Skip to content

Instantly share code, notes, and snippets.

@YutoKashiwagi
Last active January 1, 2020 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YutoKashiwagi/4062ccf7260f8437287f2568b9f4a7e4 to your computer and use it in GitHub Desktop.
Save YutoKashiwagi/4062ccf7260f8437287f2568b9f4a7e4 to your computer and use it in GitHub Desktop.
authenticate
平文パスワードを渡すと、ハッシュ化されたパスワードと一致するかを確かめ、偽であればfalse,真であればオブジェクトを返す
def authenticate(request, &login_procedure)
if has_basic_credentials?(request)
login_procedure.call(*user_name_and_password(request))
end
end
create:オブジェクトの作成と保存を同時に行い、オブジェクトを返す
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment