{"id":19437924,"url":"https://github.com/teammaestro/ngx-auth","last_synced_at":"2026-04-11T16:37:14.319Z","repository":{"id":145990577,"uuid":"106348380","full_name":"TeamMaestro/ngx-auth","owner":"TeamMaestro","description":"Extendable authentication module for Angular implementations. ","archived":false,"fork":false,"pushed_at":"2021-03-09T15:28:26.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T23:02:08.801Z","etag":null,"topics":["angular-testing","ngrx4","ngx"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TeamMaestro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-10T00:15:01.000Z","updated_at":"2022-01-30T15:55:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecf0d195-1f98-4853-889b-9765fdd8dbaf","html_url":"https://github.com/TeamMaestro/ngx-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TeamMaestro/ngx-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamMaestro%2Fngx-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamMaestro%2Fngx-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamMaestro%2Fngx-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamMaestro%2Fngx-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeamMaestro","download_url":"https://codeload.github.com/TeamMaestro/ngx-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamMaestro%2Fngx-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular-testing","ngrx4","ngx"],"created_at":"2024-11-10T15:16:17.215Z","updated_at":"2026-04-11T16:37:14.280Z","avatar_url":"https://github.com/TeamMaestro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ngx Auth\n\n[![npm](https://img.shields.io/npm/v/@teammaestro/ngx-auth.svg)](https://www.npmjs.com/package/@teammaestro/ngx-auth)\n[![npm](https://img.shields.io/npm/dt/@teammaestro/ngx-auth.svg?label=npm%20downloads)](https://www.npmjs.com/package/@teammaestro/ngx-auth)\n\n[![NPM](https://nodei.co/npm/@teammaestro/ngx-auth.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/@teammaestro/ngx-auth/)\n\nAn extendable common authentication module for any Angular application. Leverage pre-built, tested code that can be easily extended to provide your own authentication layer on-top of a stack that satisfies most business use-cases.\n\n## Getting Started\n\nImport the `NgxAuthModule` in your root `AppModule`. You can optionally extend the `BaseAuthService` to handle your own authentication endpoints (recommended).\n\n```\nimports: [\n    NgxAuthModule.forRoot([\n        {\n            provide: BaseAuthService,\n            useClass: MyCustomAuthService\n        }\n    ])\n]\n```\n\n## Actions\n\n`import { Auth } from '@teammaestro/ngx-auth';`\n\n#### Login\n\nThe `Login` action accepts a payload matching the required request body for your authentication login endpoint. In this example we pass an example username and password into the action.\n```\nthis.store$.dispatch(new Auth.Login({\n    username: 'foo',\n    password: 'bar'\n}));\n```\n\nThis information is forwarded to your login API endpoint.\n\n#### Login Success\n\nThe `LoginSuccess` action is emitted when the `AuthService.login()` method successfully returns back a `200` status code. By default we expect the response body to contain the authenticated user object.\n\nThe `authUser` property will be assigned to state based on the response body.\n\nTo extend this interaction, create an effect:\n\ni.e.:\n```typescript\nimport { Effect, Actions } from '@ngrx/effects';\nimport { Auth } from '@teammaestro/ngx-auth';\n\n@Effect()\nclass ExampleEffect {\n\n    onLoginSuccess$ = this.actions$\n        .ofType(Auth.LOGIN_SUCCESS)\n        .map(() =\u003e {\n            // extendable code\n        });\n\n    constructor(private actions$: Actions) {}\n}\n```\n\n#### Login Failed\n\nThe `LoginFailed` action is emitted when the `AuthService.login()` method returns back an invalid response code (i.e. `400 Bad Request`). The middleware will assign any response body to the `loginErrors` property of state. To access this data, subscribe to `getLoginErrors`.\n\nTo extend this interaction, create an effect:\n\ni.e.:\n```typescript\nimport { Effect, Actions } from '@ngrx/effects';\nimport { Auth } from '@teammaestro/ngx-auth';\n\n@Effect()\nclass ExampleEffect {\n\n    onLoginFailed$ = this.actions$\n        .ofType(Auth.LOGIN_FAILED)\n        .map(() =\u003e {\n            // extendable code\n        });\n\n    constructor(private actions$: Actions) {}\n}\n```\n\n#### Logout\n\nThe `Logout` action will clear all data currently stored on the `coreAuth` state container. This gives your application piece of mind that all user data is destroyed.\n\n```typescript\nthis.store$.dispatch(new Auth.Logout);\n```\n\n#### Register\n\nThe `Register` action will pass the payload to a pre-defined endpoint to handle the registration workflow. By default the payload is expect the request body for the registration endpoint.\n\n```typescript\nthis.store$.dispatch(new Auth.Register({\n    firstName: 'John',\n    lastName: 'Smith',\n    password: 'foobar',\n    email: 'john.smith@example.com'\n}));\n```\n\n#### Register Success\n\nThe `RegisterSuccess` action is emitted when the `AuthService.register()` function successfully returns back a valid status code (i.e. 200). Optionally the response body from the API can be assigned as the `authUser`.\n\nTo extend this interaction, create an effect:\n\ni.e.:\n```typescript\nimport { Effect, Actions } from '@ngrx/effects';\nimport { Auth } from '@teammaestro/ngx-auth';\n\n@Effect()\nclass ExampleEffect {\n\n    onRegisterSuccess$ = this.actions$\n        .ofType(Auth.REGISTER_SUCCESS)\n        .map(action =\u003e {\n            // extendable code\n        });\n\n    constructor(private actions$: Actions) {}\n}\n```\n\nYou may also reassign data in your own auth reducer, based on the action dispatching.\n\n```typescript\nreducer(state = initialState, action: Auth.Actions): State {\n    case Auth.REGISTER_SUCCESS:\n        return Object.assign({}, state, {\n            // extendable code\n        });\n    default: {\n        return state;\n    }\n}\n```\n\n#### Register Failed\n\nThe `RegisterFailed` action is emitted when the `AuthService.register()` function responds with an invalid status code (i.e. `400 Bad Request`). Any errors from the response body will be assigned to `registrationErrors`. You can access this data by subscribing to `getRegistrationErrors`.\n\nTo extend this interaction, create an effect:\n\ni.e.:\n\n```typescript\nimport { Effect, Actions } from '@ngrx/effects';\nimport { Auth } from '@teammaestro/ngx-auth';\n\n@Effect()\nclass ExampleEffect {\n\n    onRegisterFailed$ = this.actions$\n        .ofType(Auth.REGISTER_FAILED)\n        .map(action =\u003e {\n            // extendable code\n        });\n\n    constructor(private actions$: Actions) {}\n}\n```\n\n#### Current User\n\n_To do documentation_\n\n#### Current User Success\n\n_To do documentation_\n\n#### Current User Failed (alias: Unauthenticated)\n\n_To do documentation_\n\n\n#### Forgot Password\n\n_To do documentation_\n\n#### Reset Password\n\n_To do documentation_\n\n#### Reset Password Success\n\n_To do documentation_\n\n#### Reset Password Failed\n\n_To do documentation_\n\n### Roadmap\n\n- Plumbing to update authenticated user object\n- Extendable model for accessing/leveraging access \u0026 refresh tokens for OAuth2 authentication environments.\n- Example sample application\n\n## Contributors\n\n[\u003cimg alt=\"Sean perkins\" src=\"https://avatars1.githubusercontent.com/u/13732623?v=3\u0026s=117\" width=\"117\"\u003e](https://github.com/sean-perkins) |\n:---:\n|[Sean Perkins](https://github.com/sean-perkins)|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteammaestro%2Fngx-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteammaestro%2Fngx-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteammaestro%2Fngx-auth/lists"}