Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am redirecting a master user from localhost:7000 to the particular user's panel and that is running on localhost:7001.

In localhost:7000 i am doing the redirection process like below:

user-list.component.html

<mat-table [dataSource]="userList">
    <ng-container matColumnDef="action">
      <mat-header-cell *matHeaderCellDef>Action</mat-header-cell>
      <mat-cell *matCellDef="let element">
            <form ngNoForm [action]="http://localhost:7001/auth/user" method="POST"  target="_blank">
              <input type="hidden" value="tokenValue">
              <button>Go to user panel</button>
            </form>
        </mat-cell>
    </ng-container>
</mat-table>

In localhost:7001, I want to get that token value that is I am passing into hidden parameter from localhost:7000 redirection url.

But while doing redirection from localhost:7000 to localhost:7001/auth/user it gives an error like this: enter image description here

user-redirect.component.ts // On localhost:7001 domain

export class UserRedirectComponent implements OnInit {
    constructor() {
        this.manageRedirection();
    }
    ngOnInit() {}


    manageRedirection() {
        this.service.loginData({
        token: token, // token value that should be get from the form hidden value
    }).subscribe((response: any) => {
        if(response) {
            this.router.navigate(['/profile'])
        }
    })

    }
}

So, how can i get the hidden values from localhost:7000 to localhost:7001 domain to make the authentication process ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
377 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...