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:
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 ?