Code Monkey home page Code Monkey logo

angular2-jwt-authentication-example's Introduction

angular2-jwt-authentication-example's People

Contributors

cornflourblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular2-jwt-authentication-example's Issues

RC.6

Any chance to update it to latest angular 2.rc.6 ? :)

cli

How to add angular-cli to this project? (sorry, i'm noob)

Signature expire issue

Please help me to add condition of signature expire in auth.guard. Here, we are only checking the token exist. I want to check whether our token expire and if expire, redirect to login page.

metadata_resolver.js Uncaught Error: Can't resolve all parameters for UserService: (Http, ?).

I'm trying to run this example as an Angular CLI app. It uses webpack by default instead of SystemJS. The bundle gets built with no errors, but I've got this error on the page:

metadata_resolver.js:508 Uncaught Error: Can't resolve all parameters for UserService: (Http, ?).

CompileMetadataResolver.getDependenciesMetadata @   metadata_resolver.js:508
CompileMetadataResolver.getTypeMetadata @   metadata_resolver.js:405
(anonymous function)    @   metadata_resolver.js:552
CompileMetadataResolver.getProvidersMetadata    @   metadata_resolver.js:532
CompileMetadataResolver.getNgModuleMetadata @   metadata_resolver.js:285
RuntimeCompiler._compileComponents  @   runtime_compiler.js:126
RuntimeCompiler._compileModuleAndComponents @   runtime_compiler.js:64
RuntimeCompiler.compileModuleAsync  @   runtime_compiler.js:55
PlatformRef_._bootstrapModuleWithZone   @   application_ref.js:303
PlatformRef_.bootstrapModule    @   application_ref.js:285
(anonymous function)    @   main.ts:12
__webpack_require__ @   bootstrap 4990ebf…:52
(anonymous function)    @   zone.js:1327
__webpack_require__ @   bootstrap 4990ebf…:52
webpackJsonpCallback    @   bootstrap 4990ebf…:23
(anonymous function)    @   main.bundle.js:1

I guess it has something to do with the second argument of UserService constructor, which is of type AuthenticationService: private authenticationService: AuthenticationService.

@cornflourblue Can you please give a clue how to solve this error? I'm a noob in Angular and webpack seems a lot more easier (with literally no configuration) than SystemJS.

Fails with Exit status 2

Hello,

When I try and run this on my machine (with npm start) I get the following error message:

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
npm ERR! This is most likely a problem with the angular2-jwt-authentication-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-jwt-authentication-example
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls angular2-jwt-authentication-example
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\david\Angular2 Projects\angular2-jwt-authentication-example-master\npm-debug.log

I just downloaded the example as is from GitHub - is there something else I need to do to run it properly?

Angular2 Router - canActivate is redirecting with post request

Implemented CanActivate to guard the routes, and navigating to /login if the user is not logged in, but i can see it is redirecting with POST request, which results to 404 error.

@Injectable()
export class AuthGuard implements CanActivate {

constructor(private router: Router) { }

canActivate() {
    console.log("canActivate : AuthGuard");
    if (localStorage.getItem('currentUser')) {
        // logged in so return true
        return true;
    }

    // not logged in so redirect to login page
    this.router.navigate(['/login']);
    return false;
}

}
http://stackoverflow.com/questions/40393609/angular2-router-canactivate-is-redirecting-with-post-request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.