@stack-spot/auth-react 2.14.1-beta.1 → 2.14.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.
- package/CHANGELOG.md +249 -242
- package/out/index.d.ts +103 -4
- package/out/index.js +797 -20
- package/out/index.js.map +1 -1
- package/out/index.mjs +797 -4
- package/out/index.mjs.map +1 -1
- package/package.json +39 -39
- package/rollup.config.mjs +37 -37
- package/src/Authenticated.tsx +65 -65
- package/src/IDPLogin.tsx +102 -102
- package/src/Login.tsx +206 -206
- package/src/SSOLogin.tsx +39 -39
- package/src/SessionManager.ts +313 -296
- package/src/dictionary.ts +48 -48
- package/src/hooks.ts +34 -34
- package/src/index.ts +5 -5
- package/src/last-login-type.ts +20 -20
- package/src/provider-icons/Github.tsx +21 -21
- package/src/provider-icons/Google.tsx +17 -17
- package/src/provider-icons/Microsoft.tsx +10 -10
- package/src/types.ts +29 -29
- package/src/utils/cookies.ts +24 -24
- package/src/utils/redirect.ts +20 -20
- package/tsconfig.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,242 +1,249 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [2.14.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
###
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
## [2.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
## [2.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
###
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
## [2.12.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
###
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
## [2.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Features
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
### Bug Fixes
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
## [2.10.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
###
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
## [2.9.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### Bug Fixes
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
## [2.9.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### Bug Fixes
|
|
76
|
-
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
## [2.9.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
###
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
## [2.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
###
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
## [2.8.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### Bug Fixes
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
## [2.8.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
###
|
|
104
|
-
|
|
105
|
-
* two
|
|
106
|
-
|
|
107
|
-
## [2.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
###
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
|
|
114
|
-
## [2.7.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
###
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
|
|
121
|
-
## [2.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### Features
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
## [2.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
###
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
|
|
135
|
-
## [2.5.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
### Bug Fixes
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
|
|
142
|
-
## [2.5.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
### Bug Fixes
|
|
146
|
-
|
|
147
|
-
*
|
|
148
|
-
|
|
149
|
-
## [2.5.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
### Bug Fixes
|
|
153
|
-
|
|
154
|
-
*
|
|
155
|
-
|
|
156
|
-
## [2.5.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Bug Fixes
|
|
160
|
-
|
|
161
|
-
*
|
|
162
|
-
|
|
163
|
-
## [2.5.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
###
|
|
167
|
-
|
|
168
|
-
*
|
|
169
|
-
|
|
170
|
-
## [2.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
###
|
|
174
|
-
|
|
175
|
-
*
|
|
176
|
-
|
|
177
|
-
## [2.4.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
###
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
## [2.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
### Features
|
|
188
|
-
|
|
189
|
-
*
|
|
190
|
-
|
|
191
|
-
## [2.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
###
|
|
195
|
-
|
|
196
|
-
*
|
|
197
|
-
|
|
198
|
-
## [2.2.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
###
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
|
|
205
|
-
## [2.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
### Features
|
|
209
|
-
|
|
210
|
-
*
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
## [1.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
### Features
|
|
235
|
-
|
|
236
|
-
*
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.14.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.14.0...auth-react@v2.14.1) (2025-11-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* more logs ([#147](https://github.com/stack-spot/portal-auth-js/issues/147)) ([dcd49c9](https://github.com/stack-spot/portal-auth-js/commit/dcd49c9820c9b6879dd3183cd0b7aa21d7db0a1f))
|
|
9
|
+
|
|
10
|
+
## [2.14.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.13.0...auth-react@v2.14.0) (2025-10-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* update auth ([#141](https://github.com/stack-spot/portal-auth-js/issues/141)) ([1d1fefa](https://github.com/stack-spot/portal-auth-js/commit/1d1fefad26f463dfc5060c3d8be3fd32ce0f7f48))
|
|
16
|
+
|
|
17
|
+
## [2.13.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.12.1...auth-react@v2.13.0) (2025-09-30)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* upgrades translation and auth-core lib ([#136](https://github.com/stack-spot/portal-auth-js/issues/136)) ([fefb0ec](https://github.com/stack-spot/portal-auth-js/commit/fefb0ec18b14aaed3bd6ea08a010856954e44cfa))
|
|
23
|
+
|
|
24
|
+
## [2.12.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.12.0...auth-react@v2.12.1) (2025-08-15)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* banner authenticated ([#132](https://github.com/stack-spot/portal-auth-js/issues/132)) ([7def353](https://github.com/stack-spot/portal-auth-js/commit/7def353edcc4c30b7676c275362a7c0419bf21e1))
|
|
30
|
+
|
|
31
|
+
## [2.12.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.11.0...auth-react@v2.12.0) (2025-08-11)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* login cookies ([#130](https://github.com/stack-spot/portal-auth-js/issues/130)) ([8301cae](https://github.com/stack-spot/portal-auth-js/commit/8301cae18893f74cfd7c3057f836879e6e842c19))
|
|
37
|
+
|
|
38
|
+
## [2.11.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.10.1...auth-react@v2.11.0) (2025-08-07)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add condition to show login ([#127](https://github.com/stack-spot/portal-auth-js/issues/127)) ([65ae8d6](https://github.com/stack-spot/portal-auth-js/commit/65ae8d65cb6082f45e587f6056e9095687343e64))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* Support edp login ([#129](https://github.com/stack-spot/portal-auth-js/issues/129)) ([4cc7150](https://github.com/stack-spot/portal-auth-js/commit/4cc7150c9b553b1c36a2d69dfd314001c5db20e3))
|
|
49
|
+
|
|
50
|
+
## [2.10.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.10.0...auth-react@v2.10.1) (2025-08-04)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* add max-age and path attributes to session cookie ([#123](https://github.com/stack-spot/portal-auth-js/issues/123)) ([7ad5b20](https://github.com/stack-spot/portal-auth-js/commit/7ad5b20836a2a62240d9473e37d5978184364347))
|
|
56
|
+
|
|
57
|
+
## [2.10.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.9.3...auth-react@v2.10.0) (2025-08-01)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* logger ([#118](https://github.com/stack-spot/portal-auth-js/issues/118)) ([acd623b](https://github.com/stack-spot/portal-auth-js/commit/acd623be69266b45c73e4a80792cb0ffa718b372))
|
|
63
|
+
* releases react ([#122](https://github.com/stack-spot/portal-auth-js/issues/122)) ([f3cc242](https://github.com/stack-spot/portal-auth-js/commit/f3cc242722115c69d404e8a513695ce84ed5fc11))
|
|
64
|
+
|
|
65
|
+
## [2.9.3](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.9.2...auth-react@v2.9.3) (2025-06-18)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Bug Fixes
|
|
69
|
+
|
|
70
|
+
* handle desktop view on login ([#116](https://github.com/stack-spot/portal-auth-js/issues/116)) ([dbd2b20](https://github.com/stack-spot/portal-auth-js/commit/dbd2b2081ed4401d28e1aa36b3e8cecb6e5fccc1))
|
|
71
|
+
|
|
72
|
+
## [2.9.2](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.9.1...auth-react@v2.9.2) (2025-06-18)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
* text ([#114](https://github.com/stack-spot/portal-auth-js/issues/114)) ([2870968](https://github.com/stack-spot/portal-auth-js/commit/28709689d2d81965d1ffa2b871e8da1f9c7bf7b8))
|
|
78
|
+
|
|
79
|
+
## [2.9.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.9.0...auth-react@v2.9.1) (2025-06-17)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
* Fix login text ([#112](https://github.com/stack-spot/portal-auth-js/issues/112)) ([cdaabb1](https://github.com/stack-spot/portal-auth-js/commit/cdaabb1603f9bdd29e7387d226fdba1cb9b28653))
|
|
85
|
+
|
|
86
|
+
## [2.9.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.8.2...auth-react@v2.9.0) (2025-05-30)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* 2685 freemium ([#110](https://github.com/stack-spot/portal-auth-js/issues/110)) ([5580117](https://github.com/stack-spot/portal-auth-js/commit/5580117da15c56c60c8b96ac30428de0018960f2))
|
|
92
|
+
|
|
93
|
+
## [2.8.2](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.8.1...auth-react@v2.8.2) (2025-04-29)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Bug Fixes
|
|
97
|
+
|
|
98
|
+
* login texts ([#105](https://github.com/stack-spot/portal-auth-js/issues/105)) ([44c481b](https://github.com/stack-spot/portal-auth-js/commit/44c481bcef1c3ae7d3e55cb7b14b7156f4bf5b58))
|
|
99
|
+
|
|
100
|
+
## [2.8.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.8.0...auth-react@v2.8.1) (2025-04-28)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* some fixes to the previous two-step login PR ([#102](https://github.com/stack-spot/portal-auth-js/issues/102)) ([31db00b](https://github.com/stack-spot/portal-auth-js/commit/31db00b9f4f7592cca6005f7f0957477f1ec0318))
|
|
106
|
+
|
|
107
|
+
## [2.8.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.7.1...auth-react@v2.8.0) (2025-04-28)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
* two step login idp sso ([#98](https://github.com/stack-spot/portal-auth-js/issues/98)) ([1c6bd24](https://github.com/stack-spot/portal-auth-js/commit/1c6bd2429fd17bf869f834b8d813a1b5c4f332a2))
|
|
113
|
+
|
|
114
|
+
## [2.7.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.7.0...auth-react@v2.7.1) (2025-04-25)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Bug Fixes
|
|
118
|
+
|
|
119
|
+
* labels of social login ([#96](https://github.com/stack-spot/portal-auth-js/issues/96)) ([3ea3e01](https://github.com/stack-spot/portal-auth-js/commit/3ea3e017b5b84acc80ebdc2e225293d38a13880c))
|
|
120
|
+
|
|
121
|
+
## [2.7.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.6.0...auth-react@v2.7.0) (2025-04-25)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Features
|
|
125
|
+
|
|
126
|
+
* dynamicly load trial providers ([#93](https://github.com/stack-spot/portal-auth-js/issues/93)) ([56506b4](https://github.com/stack-spot/portal-auth-js/commit/56506b475e07a1ce1c7dcedfcd181d6975e9ba6c))
|
|
127
|
+
|
|
128
|
+
## [2.6.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.5...auth-react@v2.6.0) (2025-04-16)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### Features
|
|
132
|
+
|
|
133
|
+
* Update rd login event ([#90](https://github.com/stack-spot/portal-auth-js/issues/90)) ([f61e1bb](https://github.com/stack-spot/portal-auth-js/commit/f61e1bb591262c2d85d54c0ac57f5c32c4bdaf9b))
|
|
134
|
+
|
|
135
|
+
## [2.5.5](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.4...auth-react@v2.5.5) (2025-04-02)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Bug Fixes
|
|
139
|
+
|
|
140
|
+
* Improve loading experience ([#87](https://github.com/stack-spot/portal-auth-js/issues/87)) ([f12a41f](https://github.com/stack-spot/portal-auth-js/commit/f12a41f3797794f02cdf3a46bc0a14195ccf466f))
|
|
141
|
+
|
|
142
|
+
## [2.5.4](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.3...auth-react@v2.5.4) (2025-03-31)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
### Bug Fixes
|
|
146
|
+
|
|
147
|
+
* login form submit ([#83](https://github.com/stack-spot/portal-auth-js/issues/83)) ([668585d](https://github.com/stack-spot/portal-auth-js/commit/668585d4a368b33c5b559a30a7c974805370a61b))
|
|
148
|
+
|
|
149
|
+
## [2.5.3](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.2...auth-react@v2.5.3) (2025-03-31)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Bug Fixes
|
|
153
|
+
|
|
154
|
+
* improve login page (add provider icons) ([#81](https://github.com/stack-spot/portal-auth-js/issues/81)) ([387f298](https://github.com/stack-spot/portal-auth-js/commit/387f298ed118f064cbfd3a9efdb29c7f30aa47db))
|
|
155
|
+
|
|
156
|
+
## [2.5.2](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.1...auth-react@v2.5.2) (2025-03-27)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Bug Fixes
|
|
160
|
+
|
|
161
|
+
* Update login texts ([#79](https://github.com/stack-spot/portal-auth-js/issues/79)) ([eec69c0](https://github.com/stack-spot/portal-auth-js/commit/eec69c038b50d03564dc3f5aad6729470502b22a))
|
|
162
|
+
|
|
163
|
+
## [2.5.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.5.0...auth-react@v2.5.1) (2025-03-26)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
* propagate provider to sessionCookie ([#77](https://github.com/stack-spot/portal-auth-js/issues/77)) ([0fdd707](https://github.com/stack-spot/portal-auth-js/commit/0fdd70745e4ce4eee99254d11d62937a3cd96e9f))
|
|
169
|
+
|
|
170
|
+
## [2.5.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.4.1...auth-react@v2.5.0) (2025-03-25)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Features
|
|
174
|
+
|
|
175
|
+
* adds new restartSession method ([#72](https://github.com/stack-spot/portal-auth-js/issues/72)) ([ba97570](https://github.com/stack-spot/portal-auth-js/commit/ba975700fff3b807670d36b477ea5247845c150c))
|
|
176
|
+
|
|
177
|
+
## [2.4.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.4.0...auth-react@v2.4.1) (2025-03-24)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
### Bug Fixes
|
|
181
|
+
|
|
182
|
+
* Up packages ([#70](https://github.com/stack-spot/portal-auth-js/issues/70)) ([280011a](https://github.com/stack-spot/portal-auth-js/commit/280011ae1cd2e45f4c64417f329a866a5984df29))
|
|
183
|
+
|
|
184
|
+
## [2.4.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.3.0...auth-react@v2.4.0) (2025-03-21)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
### Features
|
|
188
|
+
|
|
189
|
+
* external providers for trial ([#64](https://github.com/stack-spot/portal-auth-js/issues/64)) ([6705623](https://github.com/stack-spot/portal-auth-js/commit/6705623fe74c6ac2286c9748699ac6b4a515f922))
|
|
190
|
+
|
|
191
|
+
## [2.3.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.2.1...auth-react@v2.3.0) (2024-11-29)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Features
|
|
195
|
+
|
|
196
|
+
* stop encoding params ([#54](https://github.com/stack-spot/portal-auth-js/issues/54)) ([0dd22fb](https://github.com/stack-spot/portal-auth-js/commit/0dd22fbc21bf67038dd5c563341812873232ff50))
|
|
197
|
+
|
|
198
|
+
## [2.2.1](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.2.0...auth-react@v2.2.1) (2024-10-24)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
### Bug Fixes
|
|
202
|
+
|
|
203
|
+
* react-auth-config-type ([#52](https://github.com/stack-spot/portal-auth-js/issues/52)) ([5ed5d73](https://github.com/stack-spot/portal-auth-js/commit/5ed5d736ec452d5ff05044e6061a70c7535e62d9))
|
|
204
|
+
|
|
205
|
+
## [2.2.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v2.1.0...auth-react@v2.2.0) (2024-10-03)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Features
|
|
209
|
+
|
|
210
|
+
* adds safelist validation to redirect url ([#45](https://github.com/stack-spot/portal-auth-js/issues/45)) ([6eba663](https://github.com/stack-spot/portal-auth-js/commit/6eba6632d31becefbb50c1ea67dae468199c6981))
|
|
211
|
+
|
|
212
|
+
## [2.1.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react-v2.0.0...auth-react@v2.1.0) (2024-08-27)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Features
|
|
216
|
+
|
|
217
|
+
* @stack-spot/auth-react ([22fd98c](https://github.com/stack-spot/portal-auth-js/commit/22fd98c2f251c491d158b5014dabed7d714683ad))
|
|
218
|
+
* default values for url parameters ([d394d03](https://github.com/stack-spot/portal-auth-js/commit/d394d03c780a193fa6e9a656f4b7bd0e9b8b731b))
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
### Bug Fixes
|
|
222
|
+
|
|
223
|
+
* delete dist before building ([97be04f](https://github.com/stack-spot/portal-auth-js/commit/97be04fe136b15c86e250c57c1e31006694bfce2))
|
|
224
|
+
* handle transition between recover session with email and tenant ([b98c396](https://github.com/stack-spot/portal-auth-js/commit/b98c396e3fd7da21dfef30b36fa0aff0be09ef19))
|
|
225
|
+
* Update color bg on Login Page ([12c5d09](https://github.com/stack-spot/portal-auth-js/commit/12c5d0905af6c956f41acd5d81c9950f11038e1d))
|
|
226
|
+
|
|
227
|
+
## [2.0.0] (2024-08-26)
|
|
228
|
+
|
|
229
|
+
* Support for login using tenant instead of email ([7f2585d](https://github.com/stack-spot/portal-auth-js/pull/42/commits/7f2585dd011a80e6bca1ac31d7736e3b6cc0dc5b))
|
|
230
|
+
|
|
231
|
+
## [1.7.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react@v1.6.0...auth-react@v1.7.0) (2024-07-19)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
### Features
|
|
235
|
+
|
|
236
|
+
* default values for url parameters ([d394d03](https://github.com/stack-spot/portal-auth-js/commit/d394d03c780a193fa6e9a656f4b7bd0e9b8b731b))
|
|
237
|
+
|
|
238
|
+
## [1.6.0](https://github.com/stack-spot/portal-auth-js/compare/auth-react-v1.5.0...auth-react@v1.6.0) (2024-07-03)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### Features
|
|
242
|
+
|
|
243
|
+
* @stack-spot/auth-react ([22fd98c](https://github.com/stack-spot/portal-auth-js/commit/22fd98c2f251c491d158b5014dabed7d714683ad))
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
### Bug Fixes
|
|
247
|
+
|
|
248
|
+
* delete dist before building ([97be04f](https://github.com/stack-spot/portal-auth-js/commit/97be04fe136b15c86e250c57c1e31006694bfce2))
|
|
249
|
+
* Update color bg on Login Page ([12c5d09](https://github.com/stack-spot/portal-auth-js/commit/12c5d0905af6c956f41acd5d81c9950f11038e1d))
|
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Session, ThirdPartyLoginParams, AuthConfig, ThirdPartyAuthType } from '@stack-spot/auth';
|
|
3
|
+
|
|
4
|
+
interface SessionManagerConfig extends Pick<AuthConfig, 'accountUrl' | 'authUrl' | 'clientId' | 'defaultTenant' | 'retry' | 'retryDelay' | 'logger'> {
|
|
5
|
+
/**
|
|
6
|
+
* The URL to redirect to when the user logs out.
|
|
7
|
+
* @default location.origin
|
|
8
|
+
*/
|
|
9
|
+
loginUrl?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The URL to redirect to when the login completes in the authentication app. If not provided, will be the same as `loginUrl`.
|
|
12
|
+
* @default loginUrl
|
|
13
|
+
*/
|
|
14
|
+
redirectUrl?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Forbidden authentication types to this Session Manager.
|
|
17
|
+
*/
|
|
18
|
+
blockedAuthTypes?: ThirdPartyAuthType[];
|
|
19
|
+
/**
|
|
20
|
+
* A URL to send login events to (observability).
|
|
21
|
+
*/
|
|
22
|
+
rdUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
type ChangeListener = (session: Session | undefined) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Controls the current session in a browser.
|
|
27
|
+
*
|
|
28
|
+
* This should not be used under a Node.JS environment.
|
|
29
|
+
*
|
|
30
|
+
* This is a singleton. To create the first instance or recover the current one, use `SessionManager.create`.
|
|
31
|
+
*/
|
|
32
|
+
declare class SessionManager {
|
|
33
|
+
private current;
|
|
34
|
+
private readonly auth;
|
|
35
|
+
private config;
|
|
36
|
+
private changeListeners;
|
|
37
|
+
private logger;
|
|
38
|
+
static instance: SessionManager | undefined;
|
|
39
|
+
private constructor();
|
|
40
|
+
static create(config: SessionManagerConfig): SessionManager;
|
|
41
|
+
private setSession;
|
|
42
|
+
restoreSession(): Promise<void>;
|
|
43
|
+
validateSharedSession(session?: Session | undefined): Promise<boolean>;
|
|
44
|
+
hasSession(): boolean;
|
|
45
|
+
getSession(): Session;
|
|
46
|
+
endSession(redirectToLogin?: boolean): Promise<void>;
|
|
47
|
+
restartSession(): Promise<void>;
|
|
48
|
+
logout({ endSession }?: {
|
|
49
|
+
endSession?: boolean;
|
|
50
|
+
} | undefined): Promise<void>;
|
|
51
|
+
startThirdPartyLogin(data: ThirdPartyLoginParams): Promise<void>;
|
|
52
|
+
urlHasThirdPartyLoginData(): boolean;
|
|
53
|
+
startThirdPartyLoginUsingTenant(data: ThirdPartyLoginParams): Promise<void>;
|
|
54
|
+
completeThirdPartyLogin(): Promise<void>;
|
|
55
|
+
getEmailForLogin(): string | undefined;
|
|
56
|
+
switchAccount(accountId: string): Promise<void>;
|
|
57
|
+
onChange(listener: ChangeListener): () => void;
|
|
58
|
+
private setSessionCookie;
|
|
59
|
+
private sendLoginEventRd;
|
|
60
|
+
getTrialEnabledProviders(): Promise<string[]>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type LoginType = 'sso' | 'idp';
|
|
64
|
+
interface BaseData {
|
|
65
|
+
type: LoginType;
|
|
66
|
+
}
|
|
67
|
+
interface SSOData extends BaseData {
|
|
68
|
+
type: 'sso';
|
|
69
|
+
email: string;
|
|
70
|
+
}
|
|
71
|
+
interface IDPData extends BaseData {
|
|
72
|
+
type: 'idp';
|
|
73
|
+
provider: 'external-idp:github' | 'external-idp:google' | 'external-idp:microsoft';
|
|
74
|
+
}
|
|
75
|
+
type LoginData = SSOData | IDPData;
|
|
76
|
+
type LoginProps = {
|
|
77
|
+
initialValue?: string;
|
|
78
|
+
onSubmit: (data: LoginData) => Promise<void>;
|
|
79
|
+
welcomeText?: string;
|
|
80
|
+
removeLoadingOnSuccess?: boolean;
|
|
81
|
+
className?: string;
|
|
82
|
+
style?: React.CSSProperties;
|
|
83
|
+
banner?: React.ReactNode;
|
|
84
|
+
showLogin?: boolean;
|
|
85
|
+
loginTypes?: LoginType[];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
type AuthStatus = 'unknown' | 'authenticated' | 'unauthenticated';
|
|
89
|
+
interface Props {
|
|
90
|
+
children: React.ReactElement;
|
|
91
|
+
onLogin?: () => void;
|
|
92
|
+
onSession?: () => void;
|
|
93
|
+
onChangeStatus?: (status: AuthStatus) => void;
|
|
94
|
+
customLoginProps?: Omit<LoginProps, 'onSubmit' | 'initialValue'>;
|
|
95
|
+
sessionManager?: SessionManager;
|
|
96
|
+
}
|
|
97
|
+
declare const Authenticated: ({ children, onLogin, onSession, customLoginProps, sessionManager, onChangeStatus }: Props) => react_jsx_runtime.JSX.Element | null;
|
|
98
|
+
|
|
99
|
+
declare function useSession(): Session | undefined;
|
|
100
|
+
|
|
101
|
+
declare const Login: ({ onSubmit, initialValue, showLogin, welcomeText, removeLoadingOnSuccess, className, style, banner, loginTypes }: LoginProps) => react_jsx_runtime.JSX.Element;
|
|
102
|
+
|
|
103
|
+
export { Authenticated, Login, SessionManager, useSession };
|