@nauth-toolkit/client-angular 0.1.92 → 0.1.94
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/esm2022/lib/recaptcha-provider.mjs +52 -0
- package/esm2022/lib/recaptcha.service.mjs +14 -2
- package/esm2022/ngmodule/auth.service.mjs +1 -1
- package/esm2022/ngmodule/nauth.module.mjs +60 -27
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/nauth-toolkit-client-angular.mjs +122 -28
- package/fesm2022/nauth-toolkit-client-angular.mjs.map +1 -1
- package/lib/recaptcha-provider.d.ts +27 -0
- package/ngmodule/nauth.module.d.ts +17 -3
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { RecaptchaServiceConfig } from './recaptcha.service';
|
|
3
|
+
/**
|
|
4
|
+
* Provides reCAPTCHA configuration and automatic script preloading.
|
|
5
|
+
*
|
|
6
|
+
* Sets up `RECAPTCHA_CONFIG` and forces `RecaptchaService` instantiation at app
|
|
7
|
+
* startup so the reCAPTCHA script preloads before the user clicks login/signup.
|
|
8
|
+
*
|
|
9
|
+
* @param config - reCAPTCHA configuration (enabled, version, siteKey, action)
|
|
10
|
+
* @returns Environment providers for reCAPTCHA
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* export const appConfig: ApplicationConfig = {
|
|
15
|
+
* providers: [
|
|
16
|
+
* provideRecaptcha({
|
|
17
|
+
* enabled: true,
|
|
18
|
+
* version: 'enterprise',
|
|
19
|
+
* siteKey: environment.recaptchaSiteKey,
|
|
20
|
+
* action: 'login',
|
|
21
|
+
* }),
|
|
22
|
+
* // ... other providers
|
|
23
|
+
* ],
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function provideRecaptcha(config: RecaptchaServiceConfig): EnvironmentProviders;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { NAuthAngularConfig } from './tokens';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import * as i1 from "@angular/common/http";
|
|
5
5
|
/**
|
|
@@ -7,7 +7,7 @@ import * as i1 from "@angular/common/http";
|
|
|
7
7
|
*
|
|
8
8
|
* Use this for NgModule-based apps (Angular 17+ with NgModule or legacy apps).
|
|
9
9
|
*
|
|
10
|
-
* @example
|
|
10
|
+
* @example Basic Setup
|
|
11
11
|
* ```typescript
|
|
12
12
|
* // app.module.ts
|
|
13
13
|
* import { NAuthModule } from '@nauth-toolkit/client-angular';
|
|
@@ -22,9 +22,23 @@ import * as i1 from "@angular/common/http";
|
|
|
22
22
|
* })
|
|
23
23
|
* export class AppModule {}
|
|
24
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example With reCAPTCHA Enterprise
|
|
27
|
+
* ```typescript
|
|
28
|
+
* NAuthModule.forRoot({
|
|
29
|
+
* baseUrl: 'http://localhost:3000/auth',
|
|
30
|
+
* tokenDelivery: 'cookies',
|
|
31
|
+
* recaptcha: {
|
|
32
|
+
* enabled: true,
|
|
33
|
+
* version: 'enterprise',
|
|
34
|
+
* siteKey: environment.recaptchaSiteKey,
|
|
35
|
+
* action: 'login',
|
|
36
|
+
* },
|
|
37
|
+
* })
|
|
38
|
+
* ```
|
|
25
39
|
*/
|
|
26
40
|
export declare class NAuthModule {
|
|
27
|
-
static forRoot(config:
|
|
41
|
+
static forRoot(config: NAuthAngularConfig): ModuleWithProviders<NAuthModule>;
|
|
28
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<NAuthModule, never>;
|
|
29
43
|
static ɵmod: i0.ɵɵNgModuleDeclaration<NAuthModule, never, [typeof i1.HttpClientModule], [typeof i1.HttpClientModule]>;
|
|
30
44
|
static ɵinj: i0.ɵɵInjectorDeclaration<NAuthModule>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nauth-toolkit/client-angular",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.94",
|
|
4
4
|
"description": "Angular adapter for nauth-toolkit client SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nauth",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@angular/common": ">=17.0.0",
|
|
26
26
|
"@angular/core": ">=17.0.0",
|
|
27
|
-
"@nauth-toolkit/client": "^0.1.
|
|
27
|
+
"@nauth-toolkit/client": "^0.1.94",
|
|
28
28
|
"rxjs": "^7.0.0 || ^8.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
package/public-api.d.ts
CHANGED