Skip to content

Commit

Permalink
fix: restore documents
Browse files Browse the repository at this point in the history
  • Loading branch information
avatsaev committed Feb 7, 2020
1 parent 07bc45f commit aea16f1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 20 deletions.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
In order to efficiently and accurately address your issue or feature request, please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. Please delete any sections or questions below that do not pertain to this request.

For general support or usage questions, please use the [Auth0 Community](https://community.auth0.com/) or [Auth0 Support](https://support.auth0.com).

### Description

Description of the bug or feature request and why it's a problem. Consider including:

- The use case or overall problem you're trying to solve
- Information about when the problem started

### Prerequisites

- [ ] I have checked the [README documentation](https://github.com/auth0/angular2-jwt/blob/master/README.md).
- [ ] I have checked the [Auth0 Community](https://community.auth0.com/) for related posts.
- [ ] I have checked for related or duplicate [Issues](https://github.com/auth0/angular2-jwt
/issues) and [PRs](https://github.com/auth0/angular2-jwt
/pulls).
- [ ] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md).
- [ ] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md).
- [ ] I am reporting this to the correct repository.

### Environment

Expand Down
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ Please include relevant links supporting this change such as a:

### Checklist

- [ ] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [ ] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [ ] All code quality tools/guidelines in the [CONTRIBUTING documentation](../CONTRIBUTING.md) have been run/followed
- [ ] All relevant assets have been compiled as directed in the [CONTRIBUTING documentation](../CONTRIBUTING.md), if applicable
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Change log

## Version [4.0.3](https://github.com/auth0/avatsaev/tags/v4.0.3) (2020-02-70)

- Angular 9 compatibility
- Angular Ivy compatibility

## Version [3.0.1](https://github.com/auth0/angular2-jwt/tags/v3.0.1) (2019-10-28)

[Full Changelog](https://github.com/auth0/angular2-jwt/compare/3.0.0..3.0.1)
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Contribution

Please read [Auth0's contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md).

## Documentation

- PR for docs site update, if needed
- Code-level documentation expectations
- 100% documentation coverage for PRs
- Include links to relevant Auth0 doc pages

## Code quality tools

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Aslan Vatsaev
Copyright (c) 2017 Auth0 Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
56 changes: 43 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# @avatsaev/angular-jwt
# @auth0/angular-jwt

[![npm version](https://badge.fury.io/js/%40avatsaev%2Fangular-jwt.svg)](https://badge.fury.io/js/%40avatsaev%2Fangular-jwt)
[![npm version](https://badge.fury.io/js/%40auth0%2Fangular-jwt.svg)](https://badge.fury.io/js/%40auth0%2Fangular-jwt)

### **NOTE:** This library is now at version 3 and is published on npm as `@auth0/angular-jwt`. If you're looking for the pre-v1.0 version of this library, it can be found in the `pre-v1.0` branch and on npm as `angular2-jwt`.

**@auth0/angular-jwt v3 is to be used with Angular v6+ and RxJS v6+. For Angular v4.3 to v5+, use @auth0/angular-jwt v1**

This library provides an `HttpInterceptor` which automatically attaches a [JSON Web Token](https://jwt.io) to `HttpClient` requests.

This library does not have any functionality for (or opinion about) implementing user authentication and retrieving JWTs to begin with. Those details will vary depending on your setup, but in most cases, you will use a regular HTTP request to authenticate your users and then save their JWTs in local storage or in a cookie if successful.

> **Note:** This library can only be used with Angular 4.3 and higher because it relies on an `HttpInterceptor` from Angular's `HttpClient`. This feature is not available on lower versions.
## Installation

```bash
# installation with npm
npm install @avatsaev/angular-jwt
npm install @auth0/angular-jwt

# installation with yarn
yarn add @avatsaev/angular-jwt
yarn add @auth0/angular-jwt
```

## Usage: Standalone
Expand All @@ -19,7 +29,7 @@ injectable features, you can simply create an instance of the utility and use it
directly:

```ts
import { JwtHelperService } from "@avatsaev/angular-jwt";
import { JwtHelperService } from "@auth0/angular-jwt";

const helper = new JwtHelperService();

Expand All @@ -35,7 +45,7 @@ Import the `JwtModule` module and add it to your imports list. Call the `forRoot
Be sure to import the `HttpClientModule` as well.

```ts
import { JwtModule } from "@avatsaev/angular-jwt";
import { JwtModule } from "@auth0/angular-jwt";
import { HttpClientModule } from "@angular/common/http";

export function tokenGetter() {
Expand Down Expand Up @@ -97,7 +107,7 @@ JwtModule.forRoot({

Authenticated requests should only be sent to domains you know and trust. Many applications make requests to APIs from multiple domains, some of which are not controlled by the developer. Since there is no way to know what the API being called will do with the information contained in the request, it is best to not send the user's token to all APIs in a blind fashion.

List any domains you wish to allow authenticated requests to be sent to by specifying them in the the `whitelistedDomains` array. **Note that standard http port 80 and https port 443 requests don't require a port to be specified. A port is only required in the whitelisted host name if you are authenticating against a non-standard port e.g. localhost:3001**
List any domains you wish to allow authenticated requests to be sent to by specifying them in the `whitelistedDomains` array. **Note that standard http port 80 and https port 443 requests don't require a port to be specified. A port is only required in the whitelisted host name if you are authenticating against a non-standard port e.g. localhost:3001**

```ts
// ...
Expand Down Expand Up @@ -212,7 +222,7 @@ Import the `JWT_OPTIONS` `InjectionToken` so that you can instruct it to use you
Create a factory function and specify the options as you normally would if you were using `JwtModule.forRoot` directly. If you need to use a service in the function, list it as a parameter in the function and pass it in the `deps` array when you provide the function.

```ts
import { JwtModule, JWT_OPTIONS } from '@avatsaev/angular-jwt';
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
import { TokenService } from './app.tokenservice';

// ...
Expand Down Expand Up @@ -249,7 +259,7 @@ NOTE: If a `jwtOptionsFactory` is defined, then `config` is ignored. _Both confi
The custom factory function approach described above can be used to get a token asynchronously with Ionic's `Storage`.

```ts
import { JwtModule, JWT_OPTIONS } from '@avatsaev/angular-jwt';
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt';
import { Storage } from '@ionic/storage';

export function jwtOptionsFactory(storage) {
Expand Down Expand Up @@ -285,7 +295,7 @@ This service contains helper functions:
## isTokenExpired (old tokenNotExpired function)

```
import { JwtHelperService } from '@avatsaev/angular-jwt';
import { JwtHelperService } from '@auth0/angular-jwt';
// ...
constructor(public jwtHelper: JwtHelperService) {}
Expand All @@ -297,7 +307,7 @@ console.log(this.jwtHelper.isTokenExpired()); // true or false
## getTokenExpirationDate

```
import { JwtHelperService } from '@avatsaev/angular-jwt';
import { JwtHelperService } from '@auth0/angular-jwt';
// ...
constructor(public jwtHelper: JwtHelperService) {}
Expand All @@ -309,7 +319,7 @@ console.log(this.jwtHelper.getTokenExpirationDate()); // date
## decodeToken

```
import { JwtHelperService } from '@avatsaev/angular-jwt';
import { JwtHelperService } from '@auth0/angular-jwt';
// ...
constructor(public jwtHelper: JwtHelperService) {}
Expand All @@ -318,9 +328,29 @@ console.log(this.jwtHelper.decodeToken(token)); // token
}
```

## What is Auth0?

Auth0 helps you to:

- Add authentication with [multiple authentication sources](https://auth0.com/docs/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others**, or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider**.
- Add authentication through more traditional **[username/password databases](https://auth0.com/docs/connections/database/custom-db)**.
- Add support for **[linking different user accounts](https://auth0.com/docs/link-accounts)** with the same user.
- Support for generating signed [Json Web Tokens](https://auth0.com/docs/jwt) to call your APIs and **flow the user identity** securely.
- Analytics of how, when and where users are logging in.
- Pull data from other sources and add it to the user profile, through [JavaScript rules](https://auth0.com/docs/rules/current).

## Create a free Auth0 account

1. Go to [Auth0](https://auth0.com/signup) and click Sign Up.
2. Use Google, GitHub or Microsoft Account to login.

## Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.

## Author

[Aslan Vatsaev](https://github.com/avatsaev)
[Auth0](auth0.com)

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build angular-jwt",
"build": "ng build angular-jwt --prod",
"postbuild": "cp ./README.md ./CHANGELOG.md ./LICENSE ./dist/angular-jwt/",
"test": "ng test",
"lint": "ng lint",
Expand Down
6 changes: 6 additions & 0 deletions projects/angular-jwt/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

0 comments on commit aea16f1

Please sign in to comment.