# @apchh/apc-auth-rxjs

> This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API.

Latest version **0.1.3** (published 2019-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @apchh/apc-auth-rxjs
pnpm add @apchh/apc-auth-rxjs
yarn add @apchh/apc-auth-rxjs
bun add @apchh/apc-auth-rxjs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2019-01-28 |
| First published | 2019-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 349 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Xavid Ramirez |
| Maintainers | xavidram |
| Keywords | apchh, auth, aungular, rxjs |

## Links

- npm: https://www.npmjs.com/package/@apchh/apc-auth-rxjs
- npm.io page: https://npm.io/package/@apchh/apc-auth-rxjs

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2019-01-28
- 0.1.2 — 2019-01-21
- 0.1.1 — 2019-01-15
- 0.1.0 — 2019-01-14
- 0.0.1 — 2019-01-03

## README

# APC Authentication using RXJS
This library's purpose is to make authentication of Angular 2+ applications fast an easy with a prebuilt, library that directly integrates with APC's authentication API.

##### Peer dependencies
This project requires the following packages besides the default Angular packages.
- `jwt-decode` - For decoding Json Web Tokens.

### Installation
You can add the package to your Angular application by either
```sh
npm install --save @apchh/apc-auth-rxjs
```
or
```sh
yarn add @apchh/apc-auth-rxjs
```

##### Update your app.module.ts
Update yoru `app.module.ts` file by integrating the code below into your pre-existing code.
```sh
const appConf: IConfig = {
    applicationId: 'apc applicationId'
};

@ngModule({
    imports: [
        APCAuthRXJSModule.forRoot(appConf)      
    ],
    providers: [AuthService]
});
```
The purpose of the `IConfig` typechecked variable is to specify to the Authentication library, an ApplicationId, and in the future, more application information that the Auth API will need to determine where the login requests are coming from, and properly authenticate the requests.

##### Implementing Authentication Guards
You can use the Auth Guard within the APC-Auth-RXJS library to protect your routes by simply adding the `AuthGuard` to the `canActivate` route field. Then add a route to `login` using the `SignInComponent` provided by the library.
```sh
import { AuthGuard, SignInComponent } from 'apc-auth-rxjs';

const routes: Routes = [
    {
        path: '',
        component: HomeComponent,
        canActivate: [AuthGuard]
    }, {
        path: 'login',
        component: SignInComponent
    }
]
```

### TODOs

- Implement JWT Token Interceptors to verify active session
- Implenent JWT Token Interceptor to append token to any and all requests
- Questioning whether or not to make Registration and change user information components or leave that to developers.
- Finish Profile Component features
    - Change Email and Password modal components
- Test Profile Tool redirect to Custom Profile Component
- Develop API integration for User Information for profile page

---
_Source: https://npm.io/package/@apchh/apc-auth-rxjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
