akveo / akveo/nebular

NbPasswordAuthStrategy not working when building with --prod

Open
#2,433 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Hello. I have a problem when building my app with the --prod. This is my code:
in my ipserver.ts:

`const ipserver = 'http://169.158.137.126:3000/';
export default ipserver;`

in my core.module.ts
.....imports....
`import ipserver from '../ipserver';`
..........

not sending data to the server when building with --prod:
......
`strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
token: {
class: NbAuthJWTToken,
key: 'token',
},
baseEndpoint: '',
login: {
// ...
endpoint: ipserver + 'user/login',
method: 'post',
redirect: {
success: '/',
failure: null,
},
},
logout: {
endpoint: '',
redirect: {
success: '/',
failure: null,
},
},
}),
],`

this way it sends the data but is not the way i like:

`strategies: [
NbPasswordAuthStrategy.setup({
name: 'email',
token: {
class: NbAuthJWTToken,
key: 'token',
},
baseEndpoint: '',
login: {
// ...
endpoint: 'http://169.158.137.126:3000/user/login',
method: 'post',
redirect: {
success: '/',
failure: null,
},
},
logout: {
endpoint: '',
redirect: {
success: '/',
failure: null,
},
},
}),
],`

I have another problem, after successful validate the credentials send to the server, the page do not redirect when open in other place distinct localhost. It shows me the message that the credentials send to the server where rights, but stays in the same route /user/login instead of sending me to /. This works fine when I open the app via localhost/dist, but no when i open it i a different pc of my LAN. I'm using XAMPP with apache. And it all works fine while using ng serve.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.