credible 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/mailers/credible/user_mailer.rb +2 -2
- data/config/initializers/warden.rb +1 -1
- data/lib/credible/session.rb +1 -1
- data/lib/credible/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af0ef8a69bffbd53bfaf823fc29a107cb6e8ae2d8da42b7463367c6cf0443c3e
|
4
|
+
data.tar.gz: 2fa77fbeaa822062e66fd2fcfa4eeef4046dc27f16c620389a2a38cd6c156b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbbe6d188e62a58ea4029a209a4f63d0987f359f3370b50657c710887e3708cd6fc04e5213073bd689a2a63af5a1ffc0b6ef1dbea94dfd186e6023f4a98755e3
|
7
|
+
data.tar.gz: 7aef0eb8eaf40fc6f5dd8f53213cb993452c67f27cee3de7ba01b25206e8252f92a6385365fa85826b0e843dc17e3937fe2cb87cbe8d0d1e7cebe13256e93ade
|
data/README.md
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
[![Gem](https://img.shields.io/gem/v/credible?logo=rubygems)](https://rubygems.org/gems/credible)
|
6
6
|
|
7
7
|
[![License](https://img.shields.io/badge/license-MIT-green.svg)](MIT-LICENSE)
|
8
|
+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
|
9
|
+
[![Contributing](https://img.shields.io/badge/contributions-welcome-blue.svg)](CONTRIBUTING.md)
|
10
|
+
[![Discord](https://img.shields.io/discord/697123984231366716?color=7289da&label=chat&logo=discord)](https://discord.gg/YMU87db)
|
8
11
|
|
9
12
|
Credible was extracted from [thombruce/helvellyn](https://github.com/thombruce/helvellyn) and is still a work in progress. The goal is to provide JWT and API token based authentication using [Warden](https://github.com/wardencommunity/warden/) for Rails API applications.
|
10
13
|
|
@@ -9,13 +9,13 @@ class Credible::UserMailer < Credible::ApplicationMailer
|
|
9
9
|
@user = params[:user]
|
10
10
|
@url = root_url(host: @settings.hostname)
|
11
11
|
@confirmation_url = @url + 'confirm/' + @user.confirmation_token
|
12
|
-
mail(from: @settings.email, to: @user.email, subject: "Welcome to #{
|
12
|
+
mail(from: @settings.email, to: @user.email, subject: "Welcome to #{Rails.application.class.module_parent_name} | Please confirm your account")
|
13
13
|
end
|
14
14
|
|
15
15
|
def invitation_email
|
16
16
|
@settings = Settings.instance
|
17
17
|
@user = params[:user]
|
18
18
|
@url = root_url(host: @settings.hostname)
|
19
|
-
mail(from: @settings.email, to: @user.email, subject: "You have been invited to #{
|
19
|
+
mail(from: @settings.email, to: @user.email, subject: "You have been invited to #{Rails.application.class.module_parent_name}")
|
20
20
|
end
|
21
21
|
end
|
@@ -25,7 +25,7 @@ Warden::Strategies.add(:jwt) do
|
|
25
25
|
jwt = header.gsub(pattern, '') if header && header.match(pattern)
|
26
26
|
token =
|
27
27
|
JWT.decode jwt, Rails.application.secrets.secret_key_base, true,
|
28
|
-
iss:
|
28
|
+
iss: Rails.application.class.module_parent_name, verify_iss: true, algorithm: 'HS256' # [1]
|
29
29
|
rescue JWT::InvalidIssuerError
|
30
30
|
fail!('Could not authenticate')
|
31
31
|
end
|
data/lib/credible/session.rb
CHANGED
data/lib/credible/version.rb
CHANGED