Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkie committed Oct 22, 2016
1 parent fb79413 commit cb633bc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ For examples of integrating **angular2-jwt** with SystemJS, see [auth0-angular2]
- [Sending Authenticated Requests](#sending-authenticated-requests)
- [Configuration Options](#configuration-options)
- [Configuring angular2-jwt with `provideAuth`](#configuring-angular2-jwt-with-provideauth)
- [Use with SystemJS](#use-with-systemjs)
- [Configuation for Ionic 2](#configuation-for-ionic-2)
- [Sending Per-Request Headers](#sending-per-request-headers)
- [Using the Observable Token Stream](#using-the-observable-token-stream)
Expand Down Expand Up @@ -154,18 +153,6 @@ import { provideAuth } from 'angular2-jwt';
})
```

### Use with SystemJS

Angular2-jwt depends on `js-base64`, which in turn potentially uses `buffer`. If you are
using SystemJS, you need to add the following to the map section of your system config:

```
'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js',
'js-base64':'npm:js-base64/base64.js',
'buffer':'@empty'
```
Note that if you wish to use buffer, you are free to depend on and provide it.

### Configuation for Ionic 2

To configure angular2-jwt in Ionic 2 applications, use the factory pattern in your `@NgModule`. Since Ionic 2 provides its own API for accessing local storage, configure the `tokenGetter` to use it.
Expand Down
4 changes: 2 additions & 2 deletions angular2-jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ export class JwtHelper {
}

// https://developer.mozilla.org/en/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem
private b64DecodeUnicode(str) {
return decodeURIComponent(Array.prototype.map.call(atob(str), (c) => {
private b64DecodeUnicode(str: any) {
return decodeURIComponent(Array.prototype.map.call(atob(str), (c: any) => {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,5 @@
"@angular/core": "^2.0.0",
"@angular/http": "^2.0.0",
"rxjs": "5.0.0-beta.12"
},
"dependencies": {
}
}

0 comments on commit cb633bc

Please sign in to comment.