New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-with-credentials

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-with-credentials

Adds a with credentials flag to all outgoing http requests.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

npm version

angular-with-credentials

angular-with-credentials is a simple service that you can use to easily add the withCredential flag to angular HTTP requests.

Install

npm install angular-with-credentials

How To Use

Import into your NgModule

import { CredentialsService } from 'angular-with-credentials';

...

@NgModule({
    providers: [
        CredentialsService,
        ...
    ]
})

Wherever your http calls are made:

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { CredentialsService } from 'angular-with-credentials';

@Injectable()
export class PizaService {
    constructor(
        private http: Http,
        private credentials: CredentialsService) {

        
        if (this.credentials) { // This is here to help with testing so you can pass in null for CredentialsService
            this.credentials.augmentXhrBuild((xhr: any) => {
                xhr.withCredentials = true;
            });
        }

    }

    // Any http calls you have

}

License

ISC License

Keywords

FAQs

Package last updated on 17 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc