@progalaxyelabs/ngx-stonescriptphp-client 1.3.1 → 1.5.0
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
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
**Note:** While published as `@progalaxyelabs/ngx-stonescriptphp-client`, this is the official client for [StoneScriptPHP](https://stonescriptphp.org). Future versions will migrate to the `@stonescriptphp` namespace.
|
|
9
9
|
|
|
10
|
-
## ✅ Authentication Support (v2.0.0)
|
|
10
|
+
## ✅ Authentication Support (v2.0.0+)
|
|
11
11
|
|
|
12
|
-
**Current Version:
|
|
12
|
+
**Current Version: 1.4.0 (Full-Page Authentication Components)**
|
|
13
13
|
|
|
14
14
|
**Fully compatible with StoneScriptPHP Framework v2.1.x authentication!**
|
|
15
15
|
|
|
@@ -19,7 +19,39 @@
|
|
|
19
19
|
- ✅ **Configurable**: Choose your auth strategy via environment config
|
|
20
20
|
- ✅ **All HTTP methods**: GET, POST, PUT, PATCH, DELETE with automatic token refresh
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### Multi-Auth Server Support (NEW)
|
|
23
|
+
- ✅ **Multiple identity providers**: Authenticate against different auth servers (customer auth vs employee auth)
|
|
24
|
+
- ✅ **Runtime server switching**: Switch between auth servers dynamically
|
|
25
|
+
- ✅ **Per-request server selection**: Specify server for individual auth calls
|
|
26
|
+
- ✅ **Backward compatible**: Single-server config still works
|
|
27
|
+
- ✅ **Use case**: Shared admin platforms that accept both customer and employee logins
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// Multi-server configuration
|
|
31
|
+
authServers: {
|
|
32
|
+
customer: { url: 'https://auth.progalaxyelabs.com', default: true },
|
|
33
|
+
employee: { url: 'https://admin-auth.progalaxyelabs.com' }
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
See [MULTI-AUTH-SERVER.md](MULTI-AUTH-SERVER.md) for complete documentation.
|
|
38
|
+
|
|
39
|
+
### Full-Page Authentication UI (NEW in v1.4.0)
|
|
40
|
+
- ✅ **AuthPageComponent**: Embeddable full-page auth with custom branding
|
|
41
|
+
- ✅ **Customizable Branding**: Logo, colors, gradients, app name, subtitle
|
|
42
|
+
- ✅ **Login/Register Toggle**: Seamless switching between modes
|
|
43
|
+
- ✅ **Styled Card Layout**: Professional gradient background with centered card
|
|
44
|
+
- ✅ **Zero Configuration**: Works out-of-the-box with sensible defaults
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// Quick Example: Branded auth page
|
|
48
|
+
<lib-auth-page
|
|
49
|
+
[providers]="['google', 'emailPassword']"
|
|
50
|
+
(authenticated)="onAuth($event)">
|
|
51
|
+
</lib-auth-page>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Modal-Based User Authentication (v2.0.0)
|
|
23
55
|
- ✅ **6 Auth Providers**: Google, LinkedIn, Apple, Microsoft, GitHub, Email/Password
|
|
24
56
|
- ✅ **Declarative Configuration**: Enable/disable providers via environment
|
|
25
57
|
- ✅ **Popup OAuth**: Social login via popup windows (no full-page redirects)
|
|
@@ -37,7 +69,7 @@ authProviders: {
|
|
|
37
69
|
|
|
38
70
|
See [Configuration](#configuration) and [AUTH-PROVIDER-CONFIG.md](AUTH-PROVIDER-CONFIG.md) for details.
|
|
39
71
|
|
|
40
|
-
📖 **Documentation**: [CHANGELOG](docs/CHANGELOG.md) | [Auth Compatibility](docs/AUTH_COMPATIBILITY.md) | [Provider Config](AUTH-PROVIDER-CONFIG.md) | [Modal Auth Spec](MODAL-AUTH-SPEC.md)
|
|
72
|
+
📖 **Documentation**: [CHANGELOG](docs/CHANGELOG.md) | [Auth Compatibility](docs/AUTH_COMPATIBILITY.md) | [Provider Config](AUTH-PROVIDER-CONFIG.md) | [Modal Auth Spec](MODAL-AUTH-SPEC.md) | [Multi-Auth Server](MULTI-AUTH-SERVER.md)
|
|
41
73
|
|
|
42
74
|
---
|
|
43
75
|
|
|
@@ -139,6 +171,76 @@ PHP Backend (StoneScriptPHP) Angular Frontend
|
|
|
139
171
|
|
|
140
172
|
## Configuration
|
|
141
173
|
|
|
174
|
+
### Branding Configuration (v1.4.0+)
|
|
175
|
+
|
|
176
|
+
Customize your authentication pages with your brand identity:
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
// app.config.ts or environment.ts
|
|
180
|
+
import { NgxStoneScriptPhpClientModule, MyEnvironmentModel } from '@progalaxyelabs/ngx-stonescriptphp-client';
|
|
181
|
+
|
|
182
|
+
export const appConfig: ApplicationConfig = {
|
|
183
|
+
providers: [
|
|
184
|
+
NgxStoneScriptPhpClientModule.forRoot({
|
|
185
|
+
apiServer: {
|
|
186
|
+
host: 'http://localhost:9100/'
|
|
187
|
+
},
|
|
188
|
+
branding: {
|
|
189
|
+
appName: 'My Platform', // Required: App name on auth pages
|
|
190
|
+
logo: '/assets/logo.png', // Optional: Logo URL
|
|
191
|
+
primaryColor: '#667eea', // Optional: Auto-generates gradient
|
|
192
|
+
gradientStart: '#667eea', // Optional: Custom gradient start
|
|
193
|
+
gradientEnd: '#764ba2', // Optional: Custom gradient end
|
|
194
|
+
subtitle: 'Secure authentication' // Optional: Subtitle text
|
|
195
|
+
}
|
|
196
|
+
} as MyEnvironmentModel)
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Using the AuthPageComponent:**
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import { Component } from '@angular/core';
|
|
205
|
+
import { AuthPageComponent, TenantSelectedEvent } from '@progalaxyelabs/ngx-stonescriptphp-client';
|
|
206
|
+
|
|
207
|
+
@Component({
|
|
208
|
+
selector: 'app-login',
|
|
209
|
+
standalone: true,
|
|
210
|
+
imports: [AuthPageComponent],
|
|
211
|
+
template: `
|
|
212
|
+
<lib-auth-page
|
|
213
|
+
[providers]="['google', 'linkedin', 'emailPassword']"
|
|
214
|
+
(authenticated)="onAuthenticated($event)">
|
|
215
|
+
</lib-auth-page>
|
|
216
|
+
`
|
|
217
|
+
})
|
|
218
|
+
export class LoginComponent {
|
|
219
|
+
onAuthenticated(event: TenantSelectedEvent) {
|
|
220
|
+
console.log('User authenticated:', event);
|
|
221
|
+
// Navigate to dashboard, etc.
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Branding Options:**
|
|
227
|
+
|
|
228
|
+
| Option | Type | Description |
|
|
229
|
+
|--------|------|-------------|
|
|
230
|
+
| `appName` | `string` | **Required**. Application name displayed on auth pages |
|
|
231
|
+
| `logo` | `string` | Optional. URL to logo image (max 200x80px recommended) |
|
|
232
|
+
| `primaryColor` | `string` | Optional. Primary brand color (hex). Auto-generates gradient if no gradient colors provided |
|
|
233
|
+
| `gradientStart` | `string` | Optional. Gradient start color (hex). Overrides primaryColor |
|
|
234
|
+
| `gradientEnd` | `string` | Optional. Gradient end color (hex). Required if gradientStart is set |
|
|
235
|
+
| `subtitle` | `string` | Optional. Subtitle text below app name |
|
|
236
|
+
|
|
237
|
+
**Default Styling:**
|
|
238
|
+
- Gradient: `linear-gradient(135deg, #667eea 0%, #764ba2 100%)`
|
|
239
|
+
- White card with rounded corners and shadow
|
|
240
|
+
- Responsive design (mobile-friendly)
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
142
244
|
### Authentication Modes (v1.0.0+)
|
|
143
245
|
|
|
144
246
|
Choose your authentication strategy based on your backend:
|