Sharing Top Content from the Angular-sphere.

tdn-auth – Angular module to interract with django-rest-auth #npm #javascript #nodejs

  • This project provides an interface with Django-rest-auth – – To use it, you must add in your app.module: – – and in the imports section: – – If you need to override some parameters from the AuthModule, you can create your custom config by extending AuthConfig: – – and then…
  • Then go to your test app root dir and do Re-start your server with following command: – – Go to the dist folder and run:

Angular module to interract with django-rest-auth

This project provides an interface with Django-rest-auth

npm install tdn-auth

To use it, you must add in your app.module:

import { AuthModule } from ‘angular-auth/auth.module’;

and in the imports section:

If you need to override some parameters from the AuthModule, you can create your custom config by extending AuthConfig:

import { Injectable } from ‘@angular/core’; import { AuthConfig } from ‘tdn-auth/auth.config’; import { environment } from ‘../environments/environment’; @Injectable() export class CustomAuthConfig extends AuthConfig { constructor() { super(); this.base_url = environment.api_base_url; } }

and then inject it in the import section like this:

Using this excellent tutorial, you simply need to run:

npm install npm run build

If you want to test it locally, go in the dist folder and run

npm link

. Then go to your test app root dir and do

Re-start your server with following command:

Go to the dist folder and run:

npm login npm publish

tdn-auth

Comments are closed, but trackbacks and pingbacks are open.