bundle binstubs bundler --force
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decrypt_cookie(cookie) | |
cookie = CGI.unescape(cookie) | |
data, iv, auth_tag = cookie.split("--").map { |v| Base64.strict_decode64(v) } | |
raise InvalidMessage if (auth_tag.nil? || auth_tag.bytes.length != 16) | |
cipher = OpenSSL::Cipher.new("aes-256-gcm") | |
secret = OpenSSL::PKCS5.pbkdf2_hmac( | |
Rails.application.secret_key_base, | |
Rails.configuration.action_dispatch.authenticated_encrypted_cookie_salt, | |
1000, |
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo add-apt-repository ppa:chris-lea/redis-server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# https://www.nginx.com/resources/wiki/start/ | |
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ | |
# https://wiki.debian.org/Nginx/DirectoryStructure | |
# | |
# In most cases, administrators will remove this file from sites-enabled/ and | |
# leave it as reference inside of sites-available where it will continue to be | |
# updated by the nginx packaging team. |
#Simple Authentication with Bcrypt
This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.
The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).
You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault
##Steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mb-5 p-4 bg-white shadow-sm"> | |
<h3>Non linear stepper</h3> | |
<div id="stepper" class="bs-stepper"> | |
<div class="bs-stepper-header" role="tablist"> | |
<div class="step" data-target="#test-nl-1"> | |
<button type="button" class="step-trigger" role="tab" id="steppertrigger1" aria-controls="test-nl-1"> | |
<span class="bs-stepper-circle"> | |
<span class="fas fa-user" aria-hidden="true"></span> | |
</span> | |
<span class="bs-stepper-label">Name</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"files.autoSave": "off", | |
"window.titleBarStyle": "custom", | |
"window.menuBarVisibility": "classic", | |
"[dart]": { | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"editor.rulers": [ | |
80 | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApiController < ApplicationController | |
# define which model will act as token authenticatable | |
acts_as_token_authentication_handler_for Login | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :null_session | |
respond_to :json | |
skip_before_filter :verify_authenticity_token, if: :json_request? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title |
NewerOlder