Skip to content

Instantly share code, notes, and snippets.

View jonbarlo's full-sized avatar

Jonathan Barquero jonbarlo

View GitHub Profile
@jonbarlo
jonbarlo / keybase.md
Created November 12, 2019 04:08
keybase.md

Keybase proof

I hereby claim:

  • I am jonbarlo on github.
  • I am jonbarlo (https://keybase.io/jonbarlo) on keybase.
  • I have a public key ASC_vbhtlGrA5EPffXkesYC6954sUvP-9p223JyAQdDGDAo

To claim this, I am signing this object:

@jonbarlo
jonbarlo / README.md
Last active September 17, 2023 16:47
How to build rails API w/JWT auth

README

Rails API using JWT as auth framework this will have user with roles

Things we will cover:

  • Project generation

    create a new Rails API-only application

    rails new rails-jwt-api-sample --api

@jonbarlo
jonbarlo / Gemfile
Last active September 27, 2016 23:43
Array Squish (without using Ruby's defined method Array#flatten native method)
source 'https://rubygems.org'
#gems by groups, env
@jonbarlo
jonbarlo / gist:77fd9f552db1a3acd30bfbc17a321745
Created May 22, 2016 06:40 — forked from ches/gist:243611
basic example of Warden authentication with Sinatra
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end