Skip to content

Instantly share code, notes, and snippets.

View saurabh-opoyi's full-sized avatar

saurabh-opoyi

View GitHub Profile
@saurabh-opoyi
saurabh-opoyi / access.lua
Created March 12, 2020 12:58 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end