@newgameplusinc/odyssey-sso 2.0.7 → 2.0.8
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.
- package/README.md +35 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ const sso = new SSO({
|
|
|
25
25
|
// Login
|
|
26
26
|
sso.login("https://your-app.com/redirect");
|
|
27
27
|
|
|
28
|
-
// Exchange token from URL and get profile
|
|
28
|
+
// Exchange token from URL and get profile (put it in the root component so that it has access to the url all the time)
|
|
29
29
|
const user = await sso.exchange();
|
|
30
30
|
|
|
31
31
|
// Fetch user profile
|
|
@@ -100,17 +100,40 @@ Logs out the user from the SSO server and clears local storage.
|
|
|
100
100
|
|
|
101
101
|
### `onEvents(cb: Cb)`
|
|
102
102
|
|
|
103
|
-
Subscribe to SDK events.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
|
|
103
|
+
Subscribe to SDK events. The `cb` callback will be called with an event object containing a `type` and `payload`.
|
|
104
|
+
|
|
105
|
+
**Event types:**
|
|
106
|
+
|
|
107
|
+
* **login** — user logged in
|
|
108
|
+
* **logout** — user logged out
|
|
109
|
+
* **refresh** — token refreshed
|
|
110
|
+
* **profile.fetch** — profile fetched
|
|
111
|
+
* **profile.update** — profile updated
|
|
112
|
+
* **profile-photo.update** — avatar updated
|
|
113
|
+
|
|
114
|
+
**Cloth events:**
|
|
115
|
+
|
|
116
|
+
* **cloth.add** — cloth added
|
|
117
|
+
* **cloth.fetch-all** — all cloths fetched
|
|
118
|
+
* **cloth.fetch** — single cloth fetched
|
|
119
|
+
* **cloth.update** — cloth updated
|
|
120
|
+
* **cloth.delete** — cloth deleted
|
|
121
|
+
|
|
122
|
+
**Material events:**
|
|
123
|
+
|
|
124
|
+
* **material.add** — material added
|
|
125
|
+
* **material.fetch-all** — all materials fetched
|
|
126
|
+
* **material.fetch** — single material fetched
|
|
127
|
+
* **material.update** — material updated
|
|
128
|
+
* **material.delete** — material deleted
|
|
129
|
+
|
|
130
|
+
**Skull events:**
|
|
131
|
+
|
|
132
|
+
* **skull.add** — skull added
|
|
133
|
+
* **skull.update** — skull updated
|
|
134
|
+
* **skull.fetch-all** — all skulls fetched
|
|
135
|
+
* **skull.fetch** — single skull fetched
|
|
136
|
+
* **skull.delete** — skull deleted
|
|
114
137
|
|
|
115
138
|
---
|
|
116
139
|
|
package/package.json
CHANGED