proof-rails 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/proof/proof_actions.rb +1 -1
- data/lib/proof/version.rb +1 -1
- data/test/dummy/log/test.log +70 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b258deb5a2e9c78ea8c8831678ae8ffcafd2657a
|
4
|
+
data.tar.gz: 4598105d0eb4106d47b2da9227475fa244da1ed2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f44f9ad80c2cf6f43072a7e32b5e34a999d7aadb08715ac9f1aaadccfbdb0760b6d9acb553326b774d98b9842485defcdd1dbcefb863c9307f326fe580e7749
|
7
|
+
data.tar.gz: 2c7196386c7bf387423cc2913c430ec3a521abf32a2e7d945746811d46a9571305808288d4360d62d77633d7163a331adca8b3a83e1e8c803d7747f08ad77eff
|
data/lib/proof/proof_actions.rb
CHANGED
@@ -21,7 +21,7 @@ module Proof
|
|
21
21
|
def login
|
22
22
|
proof_class = self.class.proof_options[:authenticatable].to_s.camelize.constantize
|
23
23
|
user = proof_class.find_by(self.class.proof_options[:identifier] => params[:identifier])
|
24
|
-
if user && user.send(self.class.proof_options[:authenticate], params[:password])
|
24
|
+
if user && user.send(self.class.proof_options[:authenticate], params[self.class.proof_options[:password]])
|
25
25
|
render json: { auth_token: Proof::Token.from_data({ user_id: user.id }) }
|
26
26
|
else
|
27
27
|
render json: { error: "Invalid Credentials." }, status: :unauthorized
|
data/lib/proof/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -2031,3 +2031,73 @@ Processing by AuthenticationController#login as HTML
|
|
2031
2031
|
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "fake@email.com"]]
|
2032
2032
|
Completed 401 Unauthorized in 1ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
2033
2033
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2034
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
2035
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2036
|
+
---------------------
|
2037
|
+
ProofTest: test_truth
|
2038
|
+
---------------------
|
2039
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2040
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2041
|
+
--------------------------------------
|
2042
|
+
TokenTest: test_create_token_from_data
|
2043
|
+
--------------------------------------
|
2044
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2045
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2046
|
+
-----------------------------------------
|
2047
|
+
TokenTest: test_create_token_from_encoded
|
2048
|
+
-----------------------------------------
|
2049
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2050
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2051
|
+
----------------------------------------------------
|
2052
|
+
RequireProofTest: test_request_authorized_with_token
|
2053
|
+
----------------------------------------------------
|
2054
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2055
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "real@email.com"], ["password_digest", "$2a$04$1Krsd6ypfTj9yNackXsY7uJMS2ppQsswAPsnGu9RXzqYdAJP/zVTu"], ["created_at", "2015-07-22 16:25:38.952313"], ["updated_at", "2015-07-22 16:25:38.952313"]]
|
2056
|
+
[1m[36m (0.2ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2057
|
+
Processing by AuthenticationController#test as HTML
|
2058
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
|
2059
|
+
Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.1ms)
|
2060
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2061
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2062
|
+
---------------------------------------------------------
|
2063
|
+
RequireProofTest: test_request_unauthorized_without_token
|
2064
|
+
---------------------------------------------------------
|
2065
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2066
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "real@email.com"], ["password_digest", "$2a$04$vNCj.XzCsXBcHHLR2bn3nu9snCZATv2OpbeS9aHUHj3tQf2w1fXo."], ["created_at", "2015-07-22 16:25:38.974020"], ["updated_at", "2015-07-22 16:25:38.974020"]]
|
2067
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2068
|
+
Processing by AuthenticationController#test as HTML
|
2069
|
+
Filter chain halted as :require_proof rendered or redirected
|
2070
|
+
Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
2071
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2072
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2073
|
+
---------------------------------------------------------
|
2074
|
+
ProofActionsTest: test_proof_actions_defines_login_method
|
2075
|
+
---------------------------------------------------------
|
2076
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2077
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "users" ("email", "password_digest", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["email", "real@email.com"], ["password_digest", "$2a$04$rcRF.HbhavsAh68bm5ITDOB9OOPVfZTnwBqslQcyTinV4Ua5tyaJy"], ["created_at", "2015-07-22 16:25:38.980066"], ["updated_at", "2015-07-22 16:25:38.980066"]]
|
2078
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2079
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2080
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2081
|
+
-------------------------------------------------------------
|
2082
|
+
ProofActionsTest: test_proof_actions_valid_user_returns_token
|
2083
|
+
-------------------------------------------------------------
|
2084
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2085
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "real@email.com"], ["password_digest", "$2a$04$39ytSwf.7Qn2MgvjQNEG1OhmztiOXExtM.QIQFQyiaXOQ5RrEdL7C"], ["created_at", "2015-07-22 16:25:38.984655"], ["updated_at", "2015-07-22 16:25:38.984655"]]
|
2086
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2087
|
+
Processing by AuthenticationController#login as HTML
|
2088
|
+
Parameters: {"identifier"=>"real@email.com", "password"=>"[FILTERED]"}
|
2089
|
+
[1m[35mUser Load (0.1ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "real@email.com"]]
|
2090
|
+
Completed 200 OK in 3ms (Views: 0.2ms | ActiveRecord: 0.1ms)
|
2091
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2092
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2093
|
+
----------------------------------------------------------------------
|
2094
|
+
ProofActionsTest: test_proof_actions_invalid_user_returns_unauthorized
|
2095
|
+
----------------------------------------------------------------------
|
2096
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2097
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "users" ("email", "password_digest", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["email", "real@email.com"], ["password_digest", "$2a$04$HQggQCjZPogk3GdfFaPZB.uwTnyGmexsiv128/F.j/dqkmfAPt.va"], ["created_at", "2015-07-22 16:25:38.994121"], ["updated_at", "2015-07-22 16:25:38.994121"]]
|
2098
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2099
|
+
Processing by AuthenticationController#login as HTML
|
2100
|
+
Parameters: {"identifier"=>"fake@email.com", "password"=>"[FILTERED]"}
|
2101
|
+
[1m[35mUser Load (0.0ms)[0m SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT 1 [["email", "fake@email.com"]]
|
2102
|
+
Completed 401 Unauthorized in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
|
2103
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|