Revision 51505
Added by Myrto Koukouli about 6 years ago
modules/uoa-repository-dashboard-gui/trunk/app/services/authentication.service.ts | ||
---|---|---|
16 | 16 |
|
17 | 17 |
private apiUrl : string = process.env.API_ENDPOINT; |
18 | 18 |
private loginUrl: string = process.env.AAI_ENDPOINT; |
19 |
private baseUrl: string = process.env.WORKFLOW_API_ENDPOINT; |
|
19 | 20 |
|
20 | 21 |
// store the URL so we can redirect after logging in |
21 | 22 |
public redirectUrl: string; |
... | ... | |
26 | 27 |
isLoggedIn: boolean = false; |
27 | 28 |
|
28 | 29 |
public loginWithState() { |
29 |
console.log(`logging in with state. Current url is: ${window.location}`);
|
|
30 |
console.log(`logging in with state. Current url is: ${this.router.url}`);
|
|
30 | 31 |
sessionStorage.setItem("state.location", this.router.url); |
31 | 32 |
window.location.href = this.loginUrl; |
32 | 33 |
} |
... | ... | |
37 | 38 |
sessionStorage.removeItem('email'); |
38 | 39 |
sessionStorage.removeItem('role'); |
39 | 40 |
this.isLoggedIn = false; |
40 |
const baseUrl = appBaseUrl; |
|
41 |
|
|
41 | 42 |
console.log('logging out, going to:'); |
42 |
console.log(`https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=${baseUrl}/landing`); |
|
43 |
window.location.href = `https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=${baseUrl}/landing`; |
|
43 |
console.log(`https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=${this.baseUrl}/landing`);
|
|
44 |
window.location.href = `https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=${this.baseUrl}/landing`;
|
|
44 | 45 |
} |
45 | 46 |
|
46 | 47 |
public tryLogin() { |
modules/uoa-repository-dashboard-gui/trunk/webpack.config.js | ||
---|---|---|
99 | 99 |
PRODUCTION: JSON.stringify(false), |
100 | 100 |
API_ENDPOINT: JSON.stringify(process.env.API_ENDPOINT || "http://aleka.athenarc.gr:8380/repomanager-service-dev"), |
101 | 101 |
FAQ_ENDPOINT: JSON.stringify(process.env.FAQ_ENDPOINT || "http://aleka.athenarc.gr:5555"), |
102 |
WORKFLOW_API_ENDPOINT: JSON.stringify(process.env.WORKFLOW_API_ENDPOINT || "https://aleka.athenarc.gr"),
|
|
102 |
WORKFLOW_API_ENDPOINT: JSON.stringify(process.env.WORKFLOW_API_ENDPOINT || "http://aleka.athenarc.gr:3000"),
|
|
103 | 103 |
AAI_ENDPOINT: JSON.stringify(process.env.AAI_ENDPOINT || "http://aleka.athenarc.gr:8380/repomanager-service-dev/openid_connect_login") |
104 | 104 |
} |
105 | 105 |
}) |
... | ... | |
127 | 127 |
PRODUCTION: JSON.stringify(true), |
128 | 128 |
API_ENDPOINT: JSON.stringify("http://aleka.athenarc.gr:8380/repomanager-service-dev"), |
129 | 129 |
FAQ_ENDPOINT: JSON.stringify("http://aleka.athenarc.gr:5555"), |
130 |
WORKFLOW_API_ENDPOINT: JSON.stringify("https://aleka.athenarc.gr"),
|
|
130 |
WORKFLOW_API_ENDPOINT: JSON.stringify("http://aleka.athenarc.gr:3000"),
|
|
131 | 131 |
AAI_ENDPOINT: JSON.stringify("http://aleka.athenarc.gr:8380/repomanager-service-dev/openid_connect_login") |
132 | 132 |
} |
133 | 133 |
}) |
Also available in: Unified diff
added some minor changes