Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#160) : changed AuthHttpError to Error #187

Closed
wants to merge 3 commits into from

Conversation

HNeukermans
Copy link

Investigation of issue #160:
I found out, that, currently Typescript does not support deriving from Error class, or at least has difficulty doing that. Extending from Error doesn't work when emitting ES5
Therefore, I changed AuthHttp to throw an instance of class Error instead of class HttpAuthError.

This fixes issue #160.

@HNeukermans
Copy link
Author

HNeukermans commented Oct 5, 2016

Token feature:
Currently, JWTHelper class is only way of asking information about the token.
Therefore, I created a separate Token class. This class is a statefull implementation of JWTHelper methods, and responsible for providing information about the token.

Updated the implementation.

  1. Token constructor, now throws exception if an invalid value is passed in.
  2. I removed the Token.Empty implementation since it has become useless.
  3. Added IPayload interface that exposes an 'expiration' API.
  4. I made Token to have a decodePayload() method, which returns an IPayload instance.

FYI: commits 2 & 3 don't belong to fix(#160), but make part of a separate 'feature' commit. My apologies.

@chenkie
Copy link
Contributor

chenkie commented Oct 23, 2016

Thanks for your PR :) I had to merge some others in first. Can you rebase so I can merge this?

@paulogr
Copy link

paulogr commented Dec 4, 2016

Any news about this issue?

@chenkie chenkie closed this May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants