Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,69 @@
<a href="https://github.com/ngx-addons/omni-auth/issues/new/choose">Request Feature</a>

![License MIT](https://img.shields.io/npm/l/%40ngx-addons%2Fomni-auth-core)
![NPM Version](https://img.shields.io/npm/v/%40ngx-addons%2Fomni-auth-core)
![Build & Tests](https://img.shields.io/github/actions/workflow/status/ngx-addons/omni-auth/pr-static-analysis.yml?label=Build%20%26%20Tests)
![Downloads](https://img.shields.io/npm/d18m/%40ngx-addons%2Fomni-auth-core)

</p>
</div>


<div align="center">
<video src="https://github.com/user-attachments/assets/bca77916-a7ca-4d28-99ae-0c7d8d5e66cc" autoplay loop muted controls="false" />
</div>

## Features
## Quick Start

1. Install the package:
```bash
pnpm install @ngx-addons/omni-auth-core @ngx-addons/omni-auth-ui-material @ngx-addons/omni-auth-cognito
```

2. Configure the package:
```typescript
import { configureAuth } from "@ngx-addons/omni-auth-core";

//...
prociders: [
configureAuthCognitoConnector({
cognito: {
userPoolId: environment.cognito.userPoolId,
userPoolClientId: environment.cognito.userPoolClientId,
},
}),
configureAuth({
authService: AuthAwsCognitoService,
})
]
//...
```

3. Use UI:

```html
<omni-auth-ui-mat></omni-auth-ui-mat>
```

## Documentation

[Documentation is available here](https://ngx-addons.github.io/omni-auth/).

## Key features
- **Zoneless**: Designed to work without Angular's NgZone for performance optimization
- **Configurable**: Flexible configuration system with default patterns
- **Routing Services**: Authentication-aware routing utilities
- **Authentication Guards**: Route protection with built-in auth guards
- **Error Handling**: Comprehensive error collection and messaging system
- **Routing Services**: Authentication-aware routing utilities
- **Type Safety**: Full TypeScript support with well-defined interfaces
- **Configurable**: Flexible configuration system with default patterns
- **Zoneless**: Designed to work without Angular's NgZone for performance optimization
- **UI Agnostic**: Compatible with various UI libraries (Material, Tailwind, PrimeNG, etc.)
- **Persistence Layer**: Supports multiple authentication backends (Cognito, Firebase, etc.)

## Documentation
## List of packages


| Package | Description | NPM Link | Downloads |
|---------|-------------|----------|----------|
| @ngx-addons/omni-auth-core | Core authentication library | [![NPM Version](https://img.shields.io/npm/v/%40ngx-addons%2Fomni-auth-core)](https://www.npmjs.com/package/@ngx-addons/omni-auth-core) | [![NPM Downloads](https://img.shields.io/npm/d18m/%40ngx-addons%2Fomni-auth-core)](https://www.npmjs.com/package/@ngx-addons/omni-auth-core) |
| @ngx-addons/omni-auth-ui-material | Material Design UI components for authentication | [![NPM Version](https://img.shields.io/npm/v/%40ngx-addons%2Fomni-auth-ui-material)](https://www.npmjs.com/package/@ngx-addons/omni-auth-ui-material) | [![NPM Downloads](https://img.shields.io/npm/d18m/%40ngx-addons%2Fomni-auth-ui-material)](https://www.npmjs.com/package/@ngx-addons/omni-auth-ui-material) |
| @ngx-addons/omni-auth-cognito | AWS Cognito connector for authentication | [![NPM Version](https://img.shields.io/npm/v/%40ngx-addons%2Fomni-auth-cognito)](https://www.npmjs.com/package/@ngx-addons/omni-auth-cognito) | [![NPM Downloads](https://img.shields.io/npm/d18m/%40ngx-addons%2Fomni-auth-cognito)](https://www.npmjs.com/package/@ngx-addons/omni-auth-cognito) |

[Documentation is available here](https://ngx-addons.github.io/omni-auth/).

## License

Expand Down
85 changes: 85 additions & 0 deletions projects/docs/src/content/demo/additional-fields/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: Additional Fields
keyword: CognitoWithMaterialPage
---

Use the following configuration to add additional fields to the sign-up form.

```html
<omni-auth-ui-mat [config]="{
signIn: {},
signUp: {
attributes: [
{
key: 'phone',
type: 'phone',
validation: {
isRequired: true,
},
content: {
placeholder: '+12 345 678 9012',
label: 'Phone Number',
requiredText: 'This field is required',
minLengthText: 'Phone number must be at least 10 characters long',
maxLengthText: 'Phone number must be at most 15 characters long',
patternText: 'Phone number must be a valid phone number',
}
},
{
key: 'fullName',
type: 'text',
validation: {
isRequired: true,
minLength: 2,
maxLength: 255,
pattern: new RegExp(/^[a-zA-Z0-9_.-]*$/),
},
content: {
label: 'Full name',
requiredText: 'Full name is required',
minLengthText: 'Full name needs to be at least 2 characters long',
maxLengthText: 'Full name can be maximum 255 characters long',
placeholder: 'Joe Doe',
patternText: 'Full name must be a valid name',
}
},
{
key: 'newsletterConsent',
type: 'checkbox',
validation: {
isRequired: true,
},
content: {
label: 'Subscribe to our newsletter',
requiredText: 'This field is required',
}
},
],
},
}">
</omni-auth-ui-mat>
```

{{ NgDocActions.playground("CognitoWithMaterialAdditionalFields") }}

## Username / Password

Simply provide config during core configuration:

```typescript
{
providers: [
configureAuth({
identifierType: 'username',
authService: AuthAwsCognitoService,
}),
]
}
```

{{ NgDocActions.playground("CognitoWithMaterialUsername") }}





20 changes: 20 additions & 0 deletions projects/docs/src/content/demo/additional-fields/ng-doc.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NgDocPage } from '@ng-doc/core';
import DemoCategory from '../demo.category';
import {
CognitoWithMaterialAdditionalFieldsComponent
} from '../../../demos/cognito-with-material-additional-fields/cognito-with-material-additional-fields.component';

const CognitoWithMaterialPage: NgDocPage = {
title: `Additional Fields`,
mdFile: ['./index.md'],
category: DemoCategory,
playgrounds: {

CognitoWithMaterialAdditionalFields: {
target: CognitoWithMaterialAdditionalFieldsComponent,
template: `<ng-doc-selector>The code is available in github repo.</ng-doc-selector>`,
},
},
};

export default CognitoWithMaterialPage;
23 changes: 0 additions & 23 deletions projects/docs/src/content/demo/cognito-with-material/email.md

This file was deleted.

155 changes: 0 additions & 155 deletions projects/docs/src/content/demo/cognito-with-material/index.md

This file was deleted.

Loading
Loading