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

Unable to register with angular 4 #5542

Closed
atomfrede opened this Issue Apr 5, 2017 · 8 comments

Comments

Projects
None yet
5 participants
@atomfrede
Member

atomfrede commented Apr 5, 2017

Overview of the issue

When trying to register a new account you can't access the page, because your are not allowed to open the register page

Motivation for or Use Case

No registration possible

Reproduce the error

Generate a new monolithic applications using jwt and angular 4

Related issues

Nothing found.

Suggest a Fix

I think the problem is in the checkLogin in UserRouteAccessService.ts. When the method hasAnyAuthority is called on the current principal this method always returns false as there is no current principal yet. So from my point of view, when a route has empty authorities ([ ]) like register it should return always true

JHipster Version(s)

Latest master.

JHipster configuration
JHipster Version(s)
matetracker@0.0.0 /home/fred/git/matetracker
├── UNMET PEER DEPENDENCY @angular/common@4.0.0
├── UNMET PEER DEPENDENCY @angular/core@4.0.0
├── generator-jhipster@4.1.1 
└── UNMET PEER DEPENDENCY zone.js@0.8.2

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.gitlab.atomfrede.matetracker",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.1.1",
    "baseName": "matetracker",
    "packageName": "com.gitlab.atomfrede.matetracker",
    "packageFolder": "com/gitlab/atomfrede/matetracker",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "gradle",
    "enableSocialSignIn": false,
    "jwtSecretKey": "cde6ceb8bd1abd7260f20b43a6a1005b95960a7f",
    "clientFramework": "angular2",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "de"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

ls: no such file or directory: .jhipster/*.json

Browsers and Operating System

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

git version 2.12.2

node: v6.9.5

npm: 3.10.10

bower: 1.6.5

gulp:
[07:39:55] CLI version 3.9.0

yeoman: 1.8.5

yarn: 0.19.1

Docker version 17.03.1-ce, build c6d412e329

docker-compose version 1.11.2, build dfed245b

Entity configuration(s) entityName.json files generated in the .jhipster directory

No entities generated.

Browsers and Operating System

Linux with latest Firefox

  • Checking this box is mandatory (this is just to show you read everything)

Of course I can provide a PR.

@suhendra-arianto

This comment has been minimized.

Show comment
Hide comment
@suhendra-arianto

suhendra-arianto Apr 10, 2017

When a new user created via user administration page wants to activate by clicking the link in the email, the activation also fails for the same reason. Practically, there is currently no way to add a new user.
This happens when using monolithic with HTTP authentication too.

suhendra-arianto commented Apr 10, 2017

When a new user created via user administration page wants to activate by clicking the link in the email, the activation also fails for the same reason. Practically, there is currently no way to add a new user.
This happens when using monolithic with HTTP authentication too.

@cloud4288

This comment has been minimized.

Show comment
Hide comment
@cloud4288

cloud4288 Apr 10, 2017

I also encounter this issue as well after upgrading from 4.0.7 to 4.2.0

cloud4288 commented Apr 10, 2017

I also encounter this issue as well after upgrading from 4.0.7 to 4.2.0

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Apr 10, 2017

Member

@atomfrede if you can provide the PR that would be great -> I think this requires a patch version ASAP, as everybody gets the issue

Member

jdubois commented Apr 10, 2017

@atomfrede if you can provide the PR that would be great -> I think this requires a patch version ASAP, as everybody gets the issue

@atomfrede

This comment has been minimized.

Show comment
Hide comment
@atomfrede

atomfrede Apr 10, 2017

Member
Member

atomfrede commented Apr 10, 2017

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Apr 11, 2017

Member

Just tried with the new fix from @atomfrede (using JWT) and for me this is still broken, so I'm reopening this

Member

jdubois commented Apr 11, 2017

Just tried with the new fix from @atomfrede (using JWT) and for me this is still broken, so I'm reopening this

@jdubois jdubois reopened this Apr 11, 2017

@atomfrede

This comment has been minimized.

Show comment
Hide comment
@atomfrede

atomfrede Apr 11, 2017

Member
Member

atomfrede commented Apr 11, 2017

@jdubois

This comment has been minimized.

Show comment
Hide comment
@jdubois

jdubois Apr 11, 2017

Member

Sorry, this is my fault!!! I was working in parallel, upgrading some dependencies, and I had another failure!

Member

jdubois commented Apr 11, 2017

Sorry, this is my fault!!! I was working in parallel, upgrading some dependencies, and I had another failure!

@jdubois jdubois closed this Apr 11, 2017

@shuryyy

This comment has been minimized.

Show comment
Hide comment
@shuryyy

shuryyy Apr 12, 2017

Hi,

I don't know if it's related but if I try log-in with facebook for example, after the login the back end create the user with ROLE_USER and status activated but when the redirect is done to the Gui whith the token we are redirected to /accessdenied.

Edit with the merge it's working.

Thanks !

shuryyy commented Apr 12, 2017

Hi,

I don't know if it's related but if I try log-in with facebook for example, after the login the back end create the user with ROLE_USER and status activated but when the redirect is done to the Gui whith the token we are redirected to /accessdenied.

Edit with the merge it's working.

Thanks !

@jdubois jdubois modified the milestone: 4.3.0 Apr 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment