@genesislcap/foundation-login 14.408.0 → 14.409.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 +6 -122
- package/package.json +15 -15
- package/docs/api/foundation-login.configure.md +0 -113
- package/docs/api/foundation-login.defaultapihost.md +0 -12
- package/docs/api/foundation-login.defaultloginconfig.md +0 -13
- package/docs/api/foundation-login.defaultloginrouting.getroutepath.md +0 -51
- package/docs/api/foundation-login.defaultloginrouting.md +0 -61
- package/docs/api/foundation-login.defaultloginrouting.navigateto.md +0 -51
- package/docs/api/foundation-login.defaultorganisation.md +0 -12
- package/docs/api/foundation-login.defaultpassword.md +0 -12
- package/docs/api/foundation-login.defaultsocketext.md +0 -12
- package/docs/api/foundation-login.defaulttemplateoptions.md +0 -16
- package/docs/api/foundation-login.defaultuser.md +0 -12
- package/docs/api/foundation-login.define.md +0 -38
- package/docs/api/foundation-login.definition.md +0 -19
- package/docs/api/foundation-login.fetchidps.md +0 -70
- package/docs/api/foundation-login.fieldconfig.md +0 -19
- package/docs/api/foundation-login.fieldconfigmap.md +0 -19
- package/docs/api/foundation-login.getloginrouting.md +0 -32
- package/docs/api/foundation-login.getssologinurl.md +0 -84
- package/docs/api/foundation-login.hostenv.md +0 -12
- package/docs/api/foundation-login.hosturl.md +0 -12
- package/docs/api/foundation-login.idp.id.md +0 -11
- package/docs/api/foundation-login.idp.md +0 -72
- package/docs/api/foundation-login.idp.type.md +0 -11
- package/docs/api/foundation-login.idpresponse.id.md +0 -11
- package/docs/api/foundation-login.idpresponse.md +0 -72
- package/docs/api/foundation-login.idpresponse.type.md +0 -11
- package/docs/api/foundation-login.ismfroute.md +0 -54
- package/docs/api/foundation-login.login.md +0 -113
- package/docs/api/foundation-login.loginconfig.autoauth.md +0 -18
- package/docs/api/foundation-login.loginconfig.autoconnect.md +0 -13
- package/docs/api/foundation-login.loginconfig.background.md +0 -30
- package/docs/api/foundation-login.loginconfig.defaultredirecturl.md +0 -18
- package/docs/api/foundation-login.loginconfig.fields.md +0 -18
- package/docs/api/foundation-login.loginconfig.hostpath.md +0 -18
- package/docs/api/foundation-login.loginconfig.localizationresources.md +0 -36
- package/docs/api/foundation-login.loginconfig.logo.md +0 -28
- package/docs/api/foundation-login.loginconfig.logoalttext.md +0 -13
- package/docs/api/foundation-login.loginconfig.md +0 -381
- package/docs/api/foundation-login.loginconfig.messagedelays.md +0 -29
- package/docs/api/foundation-login.loginconfig.omitredirecturls.md +0 -21
- package/docs/api/foundation-login.loginconfig.omitroutes.md +0 -25
- package/docs/api/foundation-login.loginconfig.redirecthandler.md +0 -13
- package/docs/api/foundation-login.loginconfig.showconnectionindicator.md +0 -13
- package/docs/api/foundation-login.loginconfig.showenvironmentindicator.md +0 -13
- package/docs/api/foundation-login.loginconfig.sso.md +0 -18
- package/docs/api/foundation-login.loginconfig.submitbuttonappearance.md +0 -25
- package/docs/api/foundation-login.loginconfig.versioninformation.md +0 -25
- package/docs/api/foundation-login.loginhosted.md +0 -55
- package/docs/api/foundation-login.loginhosted.registercommoncomponents.md +0 -18
- package/docs/api/foundation-login.loginrouting.getroutepath.md +0 -12
- package/docs/api/foundation-login.loginrouting.md +0 -91
- package/docs/api/foundation-login.loginrouting.navigateto.md +0 -12
- package/docs/api/foundation-login.md +0 -449
- package/docs/api/foundation-login.messagedelaykey.md +0 -12
- package/docs/api/foundation-login.messagedelays.md +0 -14
- package/docs/api/foundation-login.routes.md +0 -21
- package/docs/api/foundation-login.settings.md +0 -20
- package/docs/api/foundation-login.ssoconfig.md +0 -33
- package/docs/api/foundation-login.styles.md +0 -62
- package/docs/api/foundation-login.template.md +0 -51
- package/docs/api/foundation-login.templatecomponents.md +0 -25
- package/docs/api/foundation-login.templateoptions.md +0 -19
- package/docs/api/index.md +0 -30
- package/docs/api-report.md.api.md +0 -446
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [fetchIDPs](./foundation-login.fetchidps.md)
|
|
4
|
-
|
|
5
|
-
## fetchIDPs() function
|
|
6
|
-
|
|
7
|
-
Request SSO identity provider list
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
path
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
string
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
_(Optional)_
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
host
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
string
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
_(Optional)_
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
</tbody></table>
|
|
66
|
-
|
|
67
|
-
**Returns:**
|
|
68
|
-
|
|
69
|
-
Promise<[IDP](./foundation-login.idp.md)<!-- -->\[\]>
|
|
70
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [FieldConfig](./foundation-login.fieldconfig.md)
|
|
4
|
-
|
|
5
|
-
## FieldConfig type
|
|
6
|
-
|
|
7
|
-
Could be expanded to allow field ViewTemplates.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export type FieldConfig = {
|
|
13
|
-
label: string;
|
|
14
|
-
value?: any;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
pattern?: string;
|
|
17
|
-
title?: string;
|
|
18
|
-
};
|
|
19
|
-
```
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [FieldConfigMap](./foundation-login.fieldconfigmap.md)
|
|
4
|
-
|
|
5
|
-
## FieldConfigMap type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
export type FieldConfigMap = {
|
|
12
|
-
organisation: FieldConfig | null;
|
|
13
|
-
username: FieldConfig;
|
|
14
|
-
email: FieldConfig;
|
|
15
|
-
password: FieldConfig;
|
|
16
|
-
};
|
|
17
|
-
```
|
|
18
|
-
**References:** [FieldConfig](./foundation-login.fieldconfig.md)
|
|
19
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [getLoginRouting](./foundation-login.getloginrouting.md)
|
|
4
|
-
|
|
5
|
-
## getLoginRouting() function
|
|
6
|
-
|
|
7
|
-
Gets LoginRouting from the DI container.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function getLoginRouting(): LoginRouting;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
[LoginRouting](./foundation-login.loginrouting.md)
|
|
17
|
-
|
|
18
|
-
## Remarks
|
|
19
|
-
|
|
20
|
-
A utility method for host applications that are not using decorators or the DI container.
|
|
21
|
-
|
|
22
|
-
## Example
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
import { getloginRouting } from '@genesislcap/foundation-login';
|
|
27
|
-
...
|
|
28
|
-
private loginRouting = getLoginRouting();
|
|
29
|
-
...
|
|
30
|
-
this.loginRouting.navigateTo('logout');
|
|
31
|
-
```
|
|
32
|
-
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [getSSOLoginURL](./foundation-login.getssologinurl.md)
|
|
4
|
-
|
|
5
|
-
## getSSOLoginURL() function
|
|
6
|
-
|
|
7
|
-
Get SSO identity provider login URL
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getSSOLoginURL: (idp: any, path?: string, host?: string) => string
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
idp
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
any
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</td></tr>
|
|
47
|
-
<tr><td>
|
|
48
|
-
|
|
49
|
-
path
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</td><td>
|
|
53
|
-
|
|
54
|
-
string
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</td><td>
|
|
58
|
-
|
|
59
|
-
_(Optional)_
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</td></tr>
|
|
63
|
-
<tr><td>
|
|
64
|
-
|
|
65
|
-
host
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</td><td>
|
|
69
|
-
|
|
70
|
-
string
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
</td><td>
|
|
74
|
-
|
|
75
|
-
_(Optional)_
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</td></tr>
|
|
79
|
-
</tbody></table>
|
|
80
|
-
|
|
81
|
-
**Returns:**
|
|
82
|
-
|
|
83
|
-
string
|
|
84
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [hostEnv](./foundation-login.hostenv.md)
|
|
4
|
-
|
|
5
|
-
## hostEnv variable
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
hostEnv: string
|
|
12
|
-
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [hostUrl](./foundation-login.hosturl.md)
|
|
4
|
-
|
|
5
|
-
## hostUrl variable
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
hostUrl: string
|
|
12
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDP](./foundation-login.idp.md) > [id](./foundation-login.idp.id.md)
|
|
4
|
-
|
|
5
|
-
## IDP.id property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
id: string;
|
|
11
|
-
```
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDP](./foundation-login.idp.md)
|
|
4
|
-
|
|
5
|
-
## IDP interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
export interface IDP
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
<table><thead><tr><th>
|
|
17
|
-
|
|
18
|
-
Property
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</th><th>
|
|
22
|
-
|
|
23
|
-
Modifiers
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</th><th>
|
|
27
|
-
|
|
28
|
-
Type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</th><th>
|
|
32
|
-
|
|
33
|
-
Description
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</th></tr></thead>
|
|
37
|
-
<tbody><tr><td>
|
|
38
|
-
|
|
39
|
-
[id](./foundation-login.idp.id.md)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</td><td>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</td><td>
|
|
46
|
-
|
|
47
|
-
string
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</td><td>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</td></tr>
|
|
54
|
-
<tr><td>
|
|
55
|
-
|
|
56
|
-
[type](./foundation-login.idp.type.md)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</td><td>
|
|
63
|
-
|
|
64
|
-
string
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</td><td>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</td></tr>
|
|
71
|
-
</tbody></table>
|
|
72
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDP](./foundation-login.idp.md) > [type](./foundation-login.idp.type.md)
|
|
4
|
-
|
|
5
|
-
## IDP.type property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
type: string;
|
|
11
|
-
```
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDPResponse](./foundation-login.idpresponse.md) > [ID](./foundation-login.idpresponse.id.md)
|
|
4
|
-
|
|
5
|
-
## IDPResponse.ID property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
ID: string;
|
|
11
|
-
```
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDPResponse](./foundation-login.idpresponse.md)
|
|
4
|
-
|
|
5
|
-
## IDPResponse interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
export interface IDPResponse
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
<table><thead><tr><th>
|
|
17
|
-
|
|
18
|
-
Property
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</th><th>
|
|
22
|
-
|
|
23
|
-
Modifiers
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</th><th>
|
|
27
|
-
|
|
28
|
-
Type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</th><th>
|
|
32
|
-
|
|
33
|
-
Description
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</th></tr></thead>
|
|
37
|
-
<tbody><tr><td>
|
|
38
|
-
|
|
39
|
-
[ID](./foundation-login.idpresponse.id.md)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</td><td>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</td><td>
|
|
46
|
-
|
|
47
|
-
string
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</td><td>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</td></tr>
|
|
54
|
-
<tr><td>
|
|
55
|
-
|
|
56
|
-
[TYPE](./foundation-login.idpresponse.type.md)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</td><td>
|
|
63
|
-
|
|
64
|
-
string
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</td><td>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</td></tr>
|
|
71
|
-
</tbody></table>
|
|
72
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [IDPResponse](./foundation-login.idpresponse.md) > [TYPE](./foundation-login.idpresponse.type.md)
|
|
4
|
-
|
|
5
|
-
## IDPResponse.TYPE property
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
TYPE: string;
|
|
11
|
-
```
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [isMFRoute](./foundation-login.ismfroute.md)
|
|
4
|
-
|
|
5
|
-
## isMFRoute() function
|
|
6
|
-
|
|
7
|
-
A utility to check if a pathname is a route of this micro frontend.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function isMFRoute(pathname?: string): boolean;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
pathname
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
string
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
_(Optional)_ A pathname string to check, typically location.pathname, which is used when a value is omitted.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
**Returns:**
|
|
52
|
-
|
|
53
|
-
boolean
|
|
54
|
-
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [Login](./foundation-login.login.md)
|
|
4
|
-
|
|
5
|
-
## Login class
|
|
6
|
-
|
|
7
|
-
> Warning: This API is now obsolete.
|
|
8
|
-
>
|
|
9
|
-
> - Use '<!-- -->@<!-- -->genesislcap/pbc-auth' instead. 'https://www.npmjs.com/package/<!-- -->@<!-- -->genesislcap/pbc-auth'
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
Defines the login class which handles account authentication from the front-end
|
|
13
|
-
|
|
14
|
-
**Signature:**
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
export declare class Login extends FASTElement
|
|
18
|
-
```
|
|
19
|
-
**Extends:** FASTElement
|
|
20
|
-
|
|
21
|
-
## Remarks
|
|
22
|
-
|
|
23
|
-
Add the Login class as a router element, and it will handle the account authentication for you. Requires use of `@genesislcap/foundation-comms` for the and classes.
|
|
24
|
-
|
|
25
|
-
There are a lot of configuration options available, and different authentication types (such as login via SSO). Use the modules exported `configure` and `define` functions for more power.
|
|
26
|
-
|
|
27
|
-
## Example
|
|
28
|
-
|
|
29
|
-
The following is an example of using it in your app, setting it up in the router configuration. This isn't a complete routes confutation, but it contains all required configuration in regard to adding Login functionality.
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
// Import required dependencies from the foundation-login package
|
|
33
|
-
import { Login } from '@genesislcap/foundation-login';
|
|
34
|
-
// Import required dependencies from the foundation-comms package
|
|
35
|
-
// You could also import analytics events and set them up in the NavigationContributor
|
|
36
|
-
import { Auth, Session } from '@genesislcap/foundation-comms';
|
|
37
|
-
|
|
38
|
-
type RouterSettings = {
|
|
39
|
-
public?: boolean;
|
|
40
|
-
autoAuth?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Define your router config
|
|
44
|
-
export class MainRouterConfig extends RouterConfiguration<RouterSettings> {
|
|
45
|
-
// Ensure you inject in required dependencies
|
|
46
|
-
constructor(
|
|
47
|
-
@Auth private auth: Auth,
|
|
48
|
-
@Session private session: Session
|
|
49
|
-
) {
|
|
50
|
-
super();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Add Login as a route
|
|
54
|
-
public configure() {
|
|
55
|
-
...
|
|
56
|
-
this.routes.map(
|
|
57
|
-
{ path: '', redirect: 'login' },
|
|
58
|
-
{
|
|
59
|
-
path: 'login',
|
|
60
|
-
element: Login,
|
|
61
|
-
title: 'Login',
|
|
62
|
-
name: 'login',
|
|
63
|
-
layout: loginLayout,
|
|
64
|
-
settings: { public: true },
|
|
65
|
-
childRouters: true,
|
|
66
|
-
},
|
|
67
|
-
... // Other routes config here
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const session = this.session;
|
|
71
|
-
const auth = this.auth;
|
|
72
|
-
|
|
73
|
-
// Example of a FallbackRouteDefinition
|
|
74
|
-
this.routes.fallback(() =>
|
|
75
|
-
auth.isLoggedIn ? { redirect: 'not-found' } : { redirect: 'login' }
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// Example of a NavigationContributor
|
|
79
|
-
this.contributors.push({
|
|
80
|
-
navigate: async (phase) => {
|
|
81
|
-
const settings = phase.route.settings;
|
|
82
|
-
|
|
83
|
-
// Could add in processes such as analytics here
|
|
84
|
-
|
|
85
|
-
// If public route don't block
|
|
86
|
-
if (settings && settings.public) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// If logged in don't block
|
|
91
|
-
if (auth.isLoggedIn) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// If autoAuth and session is valid try to connect+auto-login
|
|
96
|
-
if (settings && settings.autoAuth && (await auth.reAuthFromSession())) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Otherwise route them to login
|
|
101
|
-
phase.cancel(() => {
|
|
102
|
-
session.captureReturnUrl();
|
|
103
|
-
FoundationRouteNav.name.replace(phase.router, 'login');
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
... // Other configuration/methods
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [LoginConfig](./foundation-login.loginconfig.md) > [autoAuth](./foundation-login.loginconfig.autoauth.md)
|
|
4
|
-
|
|
5
|
-
## LoginConfig.autoAuth property
|
|
6
|
-
|
|
7
|
-
Login automatically or require user to click a login button after a connection is established.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
autoAuth: boolean;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Remarks
|
|
16
|
-
|
|
17
|
-
Needs to manually be enabled in the NavigationContributor (see \[2\] in the example in the [Login](./foundation-login.login.md) class).
|
|
18
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [LoginConfig](./foundation-login.loginconfig.md) > [autoConnect](./foundation-login.loginconfig.autoconnect.md)
|
|
4
|
-
|
|
5
|
-
## LoginConfig.autoConnect property
|
|
6
|
-
|
|
7
|
-
Connect automatically or require user to click a connect button.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
autoConnect: boolean;
|
|
13
|
-
```
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [LoginConfig](./foundation-login.loginconfig.md) > [background](./foundation-login.loginconfig.background.md)
|
|
4
|
-
|
|
5
|
-
## LoginConfig.background property
|
|
6
|
-
|
|
7
|
-
Background styles.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
background: ElementStyles;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Remarks
|
|
16
|
-
|
|
17
|
-
See [https://developer.mozilla.org/en-US/docs/Web/CSS/background](https://developer.mozilla.org/en-US/docs/Web/CSS/background) for more information.
|
|
18
|
-
|
|
19
|
-
## Example
|
|
20
|
-
|
|
21
|
-
Setting a custom background image
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
background: css`
|
|
25
|
-
:host {
|
|
26
|
-
background-image: url(${customBGImport});
|
|
27
|
-
}
|
|
28
|
-
`,
|
|
29
|
-
```
|
|
30
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [LoginConfig](./foundation-login.loginconfig.md) > [defaultRedirectUrl](./foundation-login.loginconfig.defaultredirecturl.md)
|
|
4
|
-
|
|
5
|
-
## LoginConfig.defaultRedirectUrl property
|
|
6
|
-
|
|
7
|
-
The default URL to route the user to after a successful login.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
defaultRedirectUrl: string;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Remarks
|
|
16
|
-
|
|
17
|
-
Session.returnUrl set via Session.captureReturnUrl() trumps this value.
|
|
18
|
-
|