Registry / auth-security / tdn-auth

tdn-auth

JSON →
library5.0.9jsnpmunverified

tdn-auth is an Angular module designed to provide an interface for interacting with Django REST Auth backends. As of version 5.0.9, the package primarily targets Angular 5.x. It offers functionalities for authentication flows, including configuration overrides for base URLs and other parameters. The package has not seen updates since its last publish approximately 7 years ago, making it effectively abandoned. It is not compatible with modern Angular versions (Angular 6+) and is best suited for legacy Angular 5 applications. There is no active release cadence or ongoing development. Its key differentiator was providing a pre-built integration layer for a specific Django authentication framework at the time of its release.

npm install tdn-auth
INSTALL
IMPORT
SIG · TDN-AUTH
T
tdn-auth
auth-securityjavascriptv5.0.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AuthModule
import { AuthModule } from 'tdn-auth';
import { AuthModule } from 'angular-auth/auth.module';
The README contains a discrepancy; assume 'tdn-auth' is the correct package name. Always use `AuthModule.forRoot()` to initialize.
AuthConfig
import { AuthConfig } from 'tdn-auth/auth.config';
import { AuthConfig } from 'tdn-auth';
This is a deep import for configuration customization. Do not try to import directly from 'tdn-auth'.
CustomAuthConfig
import { Injectable } from '@angular/core'; import { AuthConfig } from 'tdn-auth/auth.config'; @Injectable() export class CustomAuthConfig extends AuthConfig { constructor() { super(); // Customize properties like base_url this.base_url = 'https://your.api.com/auth/'; } }
const CustomAuthConfig = require('tdn-auth/auth.config').AuthConfig; // Incorrect for Angular/TypeScript
Custom configuration requires extending `AuthConfig` and applying the `@Injectable()` decorator. This is a class, not a direct export.

This quickstart demonstrates how to import and initialize the `AuthModule` in an Angular application, including how to provide a custom configuration by extending `AuthConfig` to set the base URL for the Django REST Auth API.

import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AuthModule } from 'tdn-auth'; import { Injectable } from '@angular/core'; import { AuthConfig } from 'tdn-auth/auth.config'; // Assuming you have an Angular environment file for configuration const environment = { production: false, api_base_url: 'https://your-django-rest-auth-api.com/' // Replace with your Django REST Auth API base URL }; @Injectable() export class CustomAuthConfig extends AuthConfig { constructor() { super(); this.base_url = environment.api_base_url; // Further customization, e.g., token names, endpoints // this.login_url = 'auth/jwt/create/'; // this.token_name = 'access_token'; } } @NgModule({ imports: [ BrowserModule, // ... other Angular modules like HttpClientModule for API calls AuthModule.forRoot(CustomAuthConfig) // Use AuthModule with your custom configuration ], providers: [], bootstrap: [] }) export class AppModule { }
Debug
Known issues
breakingThis package is effectively abandoned and built for Angular 5.x. It will not work with Angular 6+ due to breaking changes in the Angular framework, particularly in RxJS and the Angular CLI's build process, without significant manual intervention and polyfills.
fix
For new projects or existing projects on Angular 6+, consider migrating to a actively maintained Angular authentication library or a custom solution. If locked into Angular 5.x, ensure all peer dependencies exactly match the versions specified.
affects: >=5.0.0
gotchaThe README contains a conflicting import path for `AuthModule` (`angular-auth/auth.module`) versus `AuthConfig` (`tdn-auth/auth.config`). Based on the package name `tdn-auth`, the correct import for `AuthModule` is likely directly from 'tdn-auth'.
fix
Always use `import { AuthModule } from 'tdn-auth';` and `import { AuthConfig } from 'tdn-auth/auth.config';`. Test thoroughly if an alternative path is attempted.
affects: >=5.0.0
breakingThe package has not been updated in approximately 7 years, meaning it likely contains security vulnerabilities due to unpatched dependencies or outdated authentication practices. Using it in production is highly risky.
fix
Audit all transitive dependencies for known CVEs. Strongly consider implementing a modern, actively maintained authentication solution. Do not use this package for new deployments.
affects: >=5.0.0
gotchaInitialization of `AuthModule` requires `AuthModule.forRoot()` to provide configuration. Simply importing `AuthModule` without calling `forRoot()` will result in missing providers and runtime errors.
fix
Ensure `AuthModule.forRoot()` is called within your `imports` array in the root `AppModule`, passing `CustomAuthConfig` if needed.
affects: >=5.0.0
Errors
Common errors & fixes
Error: Uncaught (in promise): Error: StaticInjectorError[AuthService]: StaticInjectorError[AuthService]: NullInjectorError: No provider for AuthService!
The AuthModule was not properly imported or initialized, specifically `forRoot()` was not called.
fix
Ensure `AuthModule.forRoot()` is included in the `imports` array of your root Angular module (e.g., `AppModule`).
Module not found: Error: Can't resolve '@angular/common/http'
This package was developed for Angular 5.x, which uses `HttpClientModule` (from `@angular/common/http`) for HTTP requests. Later Angular versions might have subtle changes or require different setup, or you might be missing this specific import.
fix
Ensure `@angular/common/http` is imported as `HttpClientModule` in your `AppModule` and listed in its `imports` array, alongside `BrowserModule`.
ERROR in node_modules/tdn-auth/tdn-auth.d.ts(XX,XX): error TS2307: Cannot find module '@angular/core' or its corresponding type declarations.
Incompatibility with newer TypeScript versions or mismatched Angular peer dependencies.
fix
This package is not compatible with modern Angular versions (6+) or their corresponding TypeScript versions. Revert to Angular 5.x and a compatible TypeScript version (e.g., TypeScript 2.5-2.7) or migrate to a different authentication library.
Upgrade
Version history
5.0.9latest on npm
Audit
Dependencies
@angular/animationsrequiredRequired for Angular application animations, part of the core Angular framework dependencies.
@angular/cdkrequiredAngular Component Dev Kit, provides foundational utilities for building Angular components, including accessibility and interaction patterns.
@angular/commonrequiredCore Angular common modules, providing common directives, pipes, and services.
@angular/compilerrequiredRequired for compiling Angular templates and components.
@angular/corerequiredThe core Angular framework, essential for any Angular application.
@angular/flex-layoutrequiredAn Angular library for building responsive layouts using Flexbox, commonly used with Angular Material.
@angular/formsrequiredProvides support for building forms in Angular applications.
@angular/materialrequiredAngular Material component library, used for UI elements.
@angular/platform-browserrequiredRequired for Angular applications running in a browser environment.
@angular/routerrequiredEssential for navigation and routing within Angular applications.
core-jsrequiredJavaScript polyfills required for older browsers or specific JavaScript features not natively supported.
ngx-cookierequiredUtility for handling cookies in Angular applications, likely used for session management or token storage.
rxjsrequiredReactive Extensions for JavaScript, used extensively in Angular for asynchronous programming and event handling.
zone.jsrequiredA patching mechanism for asynchronous operations, critical for Angular's change detection mechanism.
reflect-metadatarequiredPolyfill for the Reflect Metadata API, used by TypeScript decorators in Angular.
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources