stormpath-rails 0.3.1 → 0.3.2
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.
- data/lib/stormpath/rails/client.rb +3 -7
- data/lib/stormpath/rails/version.rb +1 -1
- metadata +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require "stormpath-sdk"
|
|
2
2
|
include Stormpath::Client
|
|
3
3
|
include Stormpath::Resource
|
|
4
|
+
include Stormpath::Authentication
|
|
4
5
|
|
|
5
6
|
module Stormpath
|
|
6
7
|
module Rails
|
|
@@ -8,8 +9,8 @@ module Stormpath
|
|
|
8
9
|
cattr_accessor :connection
|
|
9
10
|
|
|
10
11
|
def self.authenticate_account(login, password)
|
|
11
|
-
|
|
12
|
-
auth_result =
|
|
12
|
+
application = self.ds.get_resource Config[:application], ::Application
|
|
13
|
+
auth_result = application.authenticate_account ::UsernamePasswordRequest.new(login, password)
|
|
13
14
|
auth_result.get_account
|
|
14
15
|
end
|
|
15
16
|
|
|
@@ -45,11 +46,6 @@ module Stormpath
|
|
|
45
46
|
self.connection ||= ::ClientApplicationBuilder.new.set_application_href(Config[:href]).build
|
|
46
47
|
self.connection.client.data_store
|
|
47
48
|
end
|
|
48
|
-
|
|
49
|
-
def self.application
|
|
50
|
-
self.connection ||= ::ClientApplicationBuilder.new.set_application_href(Config[:href]).build
|
|
51
|
-
self.connection.application
|
|
52
|
-
end
|
|
53
49
|
end
|
|
54
50
|
end
|
|
55
51
|
end
|