verse-ruby 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54736c931a2f4e6466f2ef742900f829ee25aa33
4
- data.tar.gz: fd522a09af4cc152dc8dfca224d948292cbc43c2
3
+ metadata.gz: 255311fb8cc0e58f96a8183ba7f47866e6ec352c
4
+ data.tar.gz: 478a3c0fc53eaa66d71af0c710dd8e8329c643f4
5
5
  SHA512:
6
- metadata.gz: be6ab2073461b4d8ac918efeac17e3aa590ee41c37fe23674ef3a61c66f8ed06aa8c9e5a4877ffd04b2aec129879a0f9eec67bcae20a255a50fc5cd10d3e54c4
7
- data.tar.gz: 00bda1a1d3c08f73543dfce5fd67f49d7f033061a1335b6c1394093409ea0c8827c118b0bdf55513c9b6fbe4ae9955dfe79befc0a0872dd60aca73f1db0ad4d6
6
+ metadata.gz: d8c2a99b5871386dc39cb4fa0c57bff5dafebc93d37ed2b5534319ba0ac910c4834c1d544a1053aa1af8f2c919f553e52c3346e8ae7606e86885ff229303fb04
7
+ data.tar.gz: 8052ecb87d52a96d39d4ff078e443c1307b3208150d65f7dbe4b09d1206d1f1f8c9e152d4e3d2afc303445ee304dce59f20c337d41af0747148ce12157131574
@@ -1,27 +1,29 @@
1
1
  require 'active_support'
2
2
  require 'jwt'
3
3
 
4
- module Verse::Controller
5
- extend ActiveSupport::Concern
4
+ module Verse
5
+ module Controller
6
+ extend ActiveSupport::Concern
6
7
 
7
- included do
8
- before_action :set_user_token
9
- helper_method :current_user
10
- end
8
+ included do
9
+ before_action :set_user_token
10
+ helper_method :current_user
11
+ end
11
12
 
12
- def current_user
13
- if Verse.user_token
14
- data = JWT.decode(Verse.user_token, nil, false)[0]['data']
15
- Verse::Auth::Core::User.new(
16
- id: data['user_id'],
17
- display_name: data['display_name'],
18
- email: data['email'],
19
- username: data['username']
20
- )
13
+ def current_user
14
+ if Verse.user_token
15
+ data = JWT.decode(Verse.user_token, nil, false)[0]['data']
16
+ Verse::Auth::Core::User.new(
17
+ id: data['user_id'],
18
+ display_name: data['display_name'],
19
+ email: data['email'],
20
+ username: data['username']
21
+ )
22
+ end
21
23
  end
22
- end
23
24
 
24
- def set_user_token
25
- Verse.user_token = cookies[:user_token]
25
+ def set_user_token
26
+ Verse.user_token = cookies[:user_token]
27
+ end
26
28
  end
27
29
  end
data/lib/verse/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Verse
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verse-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce