@progalaxyelabs/ngx-stonescriptphp-client 1.6.0 → 1.8.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.
package/README.md CHANGED
@@ -9,7 +9,12 @@
9
9
 
10
10
  ## ✅ Authentication Support (v2.0.0+)
11
11
 
12
- **Current Version: 1.4.0 (Full-Page Authentication Components)**
12
+ **Current Version: 1.8.1**
13
+
14
+ ### Recent Updates
15
+ - **v1.8.1**: Renamed `authServer` to `accountsServer` for naming consistency
16
+ - **v1.8.0**: Added `accountsServer` property for microservices architecture
17
+ - **v1.7.1**: Fixed URL concatenation (removed trailing slash requirement)
13
18
 
14
19
  **Fully compatible with StoneScriptPHP Framework v2.1.x authentication!**
15
20
 
@@ -171,6 +176,40 @@ PHP Backend (StoneScriptPHP) Angular Frontend
171
176
 
172
177
  ## Configuration
173
178
 
179
+ ### Server Configuration (v1.7.1+)
180
+
181
+ **Important:** As of v1.7.1, host URLs should **NOT** include trailing slashes. Endpoints should include leading slashes.
182
+
183
+ ```typescript
184
+ // app.config.ts
185
+ NgxStoneScriptPhpClientModule.forRoot({
186
+ // ✅ Correct: No trailing slash
187
+ apiServer: { host: 'http://localhost:3011' },
188
+
189
+ // ❌ Wrong: Has trailing slash
190
+ // apiServer: { host: 'http://localhost:3011/' },
191
+ })
192
+ ```
193
+
194
+ **For Microservices:**
195
+ If your authentication is on a different server than your API, use `accountsServer` (v1.8.1+):
196
+
197
+ ```typescript
198
+ NgxStoneScriptPhpClientModule.forRoot({
199
+ apiServer: { host: 'http://localhost:3011' }, // Business API
200
+ accountsServer: { host: 'http://localhost:3139' }, // Auth service
201
+ auth: {
202
+ mode: 'body',
203
+ refreshEndpoint: '/api/auth/refresh' // Just the path, no server URL
204
+ }
205
+ })
206
+ ```
207
+
208
+ **Fallback chain for auth server:**
209
+ 1. `accountsServer.host` (if specified)
210
+ 2. `accountsUrl` (deprecated, for backward compatibility)
211
+ 3. `apiServer.host` (same-server auth)
212
+
174
213
  ### Branding Configuration (v1.4.0+)
175
214
 
176
215
  Customize your authentication pages with your brand identity:
@@ -183,7 +222,7 @@ export const appConfig: ApplicationConfig = {
183
222
  providers: [
184
223
  NgxStoneScriptPhpClientModule.forRoot({
185
224
  apiServer: {
186
- host: 'http://localhost:9100/'
225
+ host: 'http://localhost:9100' // No trailing slash
187
226
  },
188
227
  branding: {
189
228
  appName: 'My Platform', // Required: App name on auth pages