@flusys/ng-auth 7.0.2 → 8.0.0-beta.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/README.md +36 -3
- package/fesm2022/flusys-ng-auth.mjs +1271 -291
- package/fesm2022/flusys-ng-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/flusys-ng-auth.d.ts +160 -14
package/README.md
CHANGED
|
@@ -45,11 +45,11 @@ import { AUTH_ROUTES, ADMINISTRATION_ROUTES, PROFILE_ROUTES } from '@flusys/ng-a
|
|
|
45
45
|
export const routes: Routes = [
|
|
46
46
|
{
|
|
47
47
|
path: 'auth',
|
|
48
|
-
loadChildren: () => AUTH_ROUTES, // login, register, forgot-password, reset-password, verify-email
|
|
48
|
+
loadChildren: () => AUTH_ROUTES, // login, register, forgot-password, reset-password, verify-email, social/callback
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
path: 'administration',
|
|
52
|
-
loadChildren: () => ADMINISTRATION_ROUTES, // users, company, branch (protected by authGuard)
|
|
52
|
+
loadChildren: () => ADMINISTRATION_ROUTES, // users, company, branch, social-config (protected by authGuard)
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
path: 'profile',
|
|
@@ -127,7 +127,40 @@ authInit.initialize().subscribe(isAuthenticated => {
|
|
|
127
127
|
|
|
128
128
|
The `initialized` signal is `true` after the first call completes (success or failure).
|
|
129
129
|
|
|
130
|
-
## 7.
|
|
130
|
+
## 7. Social Sign-In
|
|
131
|
+
|
|
132
|
+
The login page already renders `<lib-social-login-buttons />`. It asks the
|
|
133
|
+
backend which providers an administrator enabled and renders nothing when the
|
|
134
|
+
answer is none, so no configuration is needed to keep the page as it was. A
|
|
135
|
+
provider list that fails to load never blocks password sign-in.
|
|
136
|
+
|
|
137
|
+
Two routes make the rest of the flow work, and both come with the routes above:
|
|
138
|
+
|
|
139
|
+
| Route | Purpose |
|
|
140
|
+
| --------------------------------- | ------------------------------------------------------------------- |
|
|
141
|
+
| `/auth/social/callback` | Where every provider sends the browser back to; exchanges the code |
|
|
142
|
+
| `/administration/social-config` | Provider credentials, behind the `social-config.read` permission |
|
|
143
|
+
|
|
144
|
+
The redirect URI is always `{origin}/auth/social/callback` — the social config
|
|
145
|
+
page prints it so it can be pasted into the provider's own console. A sign-in
|
|
146
|
+
that still needs a company hands the selection state to the login page, which
|
|
147
|
+
already renders that step, so social and password sign-in end the same way.
|
|
148
|
+
|
|
149
|
+
Whether an unknown email gets an account is decided by the backend's
|
|
150
|
+
`bootstrapAppConfig.enableSignUp`, not by `APP_CONFIG.enableSignUp` — the frontend
|
|
151
|
+
flag only hides the sign-up link and blocks `/auth/register`. Keep the two in sync,
|
|
152
|
+
or the login page will offer a provider the backend then refuses.
|
|
153
|
+
|
|
154
|
+
Drop the buttons into a page of your own with:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { SocialLoginButtonsComponent } from '@flusys/ng-auth';
|
|
158
|
+
|
|
159
|
+
@Component({ imports: [SocialLoginButtonsComponent], template: `<lib-social-login-buttons />` })
|
|
160
|
+
export class MySignInPage {}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## 8. Extend Registration / Profile (Optional)
|
|
131
164
|
|
|
132
165
|
Inject custom fields and sections via extension tokens:
|
|
133
166
|
|