castle-rb 1.0.5 → 1.0.6
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/README.md +18 -0
- data/lib/castle.rb +4 -0
- data/lib/castle/version.rb +1 -1
- 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: da65c9def9b0ff8c49dc58216030b24656a4c73c
|
4
|
+
data.tar.gz: 7c8dacb82d986baf51a16adac10dc6cc86d3a909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17364b5ee431f2b715708b19e495c96bcea331cc0c8b537aa0ad819d7ac71d746777f88555026772b2c4d107dc8c930912badf5733a3576fbdad9c3baa459d23
|
7
|
+
data.tar.gz: 8b1abb0fbee5840e9f8fb8e3a9b5cef3e1b217e2c2bc817e3e215d7aa73237f64eb57b9e375cada367672312b876b9c81e83b4696b2fb1d93b510d0af1295a7c
|
data/README.md
CHANGED
@@ -64,6 +64,24 @@ castle.track(
|
|
64
64
|
|
65
65
|
- `$login`: The submitted email or username from when the user attempted to log in or reset their password. Useful when there is no `user_id` available.
|
66
66
|
|
67
|
+
## Secure mode
|
68
|
+
|
69
|
+
Avoid client-side spoofing by having your backend sign the user data with `secure_encode`.
|
70
|
+
|
71
|
+
```erb
|
72
|
+
_castle('setUser', '<%= Castle.secure_encode({
|
73
|
+
id: current_user.id,
|
74
|
+
email: current_user.email }) %>');
|
75
|
+
```
|
76
|
+
|
77
|
+
This will use your API Secret to encode the data into [JWT](http://jwt.io) format, for example:
|
78
|
+
|
79
|
+
```javascript
|
80
|
+
_castle('setUser', 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1...y4PCIXrz1Ejs');
|
81
|
+
```
|
82
|
+
|
83
|
+
**Important:** Make sure you enable **Secure mode** in the [Castle dashboard](https://dashboard.castle.io/settings/general).
|
84
|
+
|
67
85
|
## Configuration
|
68
86
|
|
69
87
|
```ruby
|
data/lib/castle.rb
CHANGED
data/lib/castle/version.rb
CHANGED