simple_jwt_auth 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 78d74d4d58750fc699e438212a1eb4d9f600c8aacebd23947e10b1ea5a8ab674
4
- data.tar.gz: 4aa27eaeb5b1ead68fc77dd914ce12aee0ea75c180d7d9acd782f26b3e4839e7
3
+ metadata.gz: 1c6053fd30a7009d6dfd60acf15685ce90dfa7d71e7461516d73962a115607a8
4
+ data.tar.gz: f8ce064539c2c1419e015a2d18cf0117045046a02bc0877ef4f7de24a7986db6
5
5
  SHA512:
6
- metadata.gz: 9610ecf297ae4156e6945b42aa659ecd5bc3d4cdc2ef453bec925054404f1ed48a91db1ebe1683ce06cb236766b4f14e6311d1fc7dd28219ccfc74f8fb6a6e38
7
- data.tar.gz: 1beffab4245f75424b2c77f37e3468ed8d34c406ec62555f6efc7ecd6a35076be90dcb33f7ab52ca40f73188b601dd189b8b424bdb8b706cc7bf3c3dfe45f339
6
+ metadata.gz: 01b7ca7686a3c758ce56d29483810aaae5d0b5ddc6c17918eda5c523b85d5d554d017a9cee4f1b43765f5ddae5a5c9d2fa9af1bb920f9228e73a529fe1d1e7de
7
+ data.tar.gz: 010b968f1b46d55c57c61eec852f0264a022468894afff557ce81bca370b2df6f4ffe546707e18ec920a6f9626c950108ef7973f51d180145cb1b7965035ce71
data/README.md CHANGED
@@ -43,6 +43,7 @@ with email and password as params.
43
43
 
44
44
  #### Logged in
45
45
  Add header called "Authorization" and set it to "Bearer #your-jwt-token-here" include this in any request you want the user to be logged in for.
46
-
46
+ A GET request can then be made to https://localhost:3000/auth/user to return the current user object.
47
+
47
48
  ## License
48
49
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,4 +1,12 @@
1
1
  class UsersController < ApplicationController
2
+ def show
3
+ if current_user
4
+ render json: { email: current_user.email, user_id: current_user.id }
5
+ else
6
+ render json: {}, status: :unauthorized
7
+ end
8
+ end
9
+
2
10
  def create
3
11
  user = User.new(user_params)
4
12
 
@@ -1,6 +1,7 @@
1
1
  Rails.application.routes.draw do
2
2
  scope :auth do
3
3
  resources :users, only: [:create]
4
+ resource :user, only: [:show]
4
5
  resources :sessions, only: [:create]
5
6
  end
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleJwtAuth
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - brye
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-25 00:00:00.000000000 Z
11
+ date: 2020-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails