tramway-api 0.2.1 → 0.2.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03fbedd30fa36978033c8708ebaeb33aa299d421d20579af7c79f5a93c7a45b2
|
4
|
+
data.tar.gz: 6ad47c29de3d35109b6a0be88ef265c1a8d805eb1044e8b4826b12ba3e178b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e7353971838d17ec2c0bb1dddbaa12afe1d5273ced54e1c663ca7e9039a70829fb01d0e1a5e343bdcf673ce8d7911e4d57db04a5b36834304c3e3d1fe483166
|
7
|
+
data.tar.gz: 35bc486bf678c29fba6d53c5bf9053e5c7bb591ff2bfdb48309864eac44cd058577f66c936c5f30ec22c843fae8ff69332849bbb654814271bfe1cf7c41c45cd
|
@@ -1,8 +1,10 @@
|
|
1
|
+
require 'tramway/api/authenticate_helper'
|
2
|
+
|
1
3
|
module Tramway
|
2
4
|
module Api
|
3
5
|
class ApplicationController < ::Tramway::Core::ApplicationController
|
4
6
|
include Knock::Authenticable
|
5
|
-
include AuthenticateHelper
|
7
|
+
include ::Tramway::Api::AuthenticateHelper
|
6
8
|
protect_from_forgery with: :null_session, if: proc { |c| c.request.format == 'application/json' }
|
7
9
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
8
10
|
|
@@ -6,7 +6,7 @@ class Tramway::Api::V1::UsersController < ::Tramway::Api::V1::ApplicationControl
|
|
6
6
|
|
7
7
|
def create
|
8
8
|
user_form = form_class_name(Tramway::Api.user_based_model).new Tramway::Api.user_based_model.new
|
9
|
-
if user_form.validate params
|
9
|
+
if user_form.validate params[Tramway::Api.user_based_model.name.underscore]
|
10
10
|
user_form.save
|
11
11
|
token = ::Knock::AuthToken.new(payload: { sub: user_form.model.id }).token
|
12
12
|
serialized_user = OpenStruct.new user_form.model.attributes.merge authentication_token: token
|
data/lib/tramway/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1
|
4
|
+
version: 0.2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: knock
|