kemal_jwt_auth
Version, currently 1.0.12 versions
- 1.0.1latestJun 21, 2019
- 1.0.0not indexedJun 21, 2019
github.com/dscottboggs/kemal-jwt-auth
Drop-in authentication for Kemal using JWTs
6 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
kemal_jwt_auth:
github: dscottboggs/kemal-jwt-auth
version: ~> 1.0.1Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- D. Scott Boggs
Dependencies
This version declares no dependencies.
README
Kemal JWT Authentication
Drop-in authentication middleware for Kemal, independent of user model. See example.cr for a full example.
TL;DR:
require "kemal"
require "kemal_jwt_auth"
# you can use your existing users collection data-structure.
require "./my_users"
# Your `MyUsers` must include the `KemalJWTAuth::UsersCollection` module
collection = MyUsers.default_config
add_handler KemalJWTAuth::Handler.new users: collection
get "/test" do |context|
if user = context.current_user?
"Welcome, #{user}!"
else
"no user found"
end
end
Kemal.run
JavaScript companion
There is a JavaScript companion library to make using this library with an SPA or other JavaScript client a cinch. See the client repository for more information
Installation
-
Add the dependency to your
shard.yml:dependencies: kemal_jwt_auth: github: dscottboggs/kemal_jwt_auth version: ~> 1.0 -
Run
shards install
Contributing
- Fork it (https://github.com/dscottboggs/kemal_jwt_auth/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- D. Scott Boggs - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.1- Tagged
- Jun 21, 2019
- Commit
46f33e4ddfd1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dscottboggs/kemal-jwt-auth
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 2