dashboard
This commit is contained in:
@@ -35,7 +35,7 @@ export class LoginComponent {
|
||||
}
|
||||
|
||||
loginWithSessionId() {
|
||||
const id = window.localStorage.getItem("auth_sesion_key");
|
||||
const id = window.localStorage.getItem("auth_session_key");
|
||||
if (!id ||id.length < 2) { return; }
|
||||
|
||||
this.http.post('api/auth/login-with-session-id', {
|
||||
@@ -50,7 +50,15 @@ export class LoginComponent {
|
||||
).subscribe({
|
||||
next: (data) => {
|
||||
if (data["code"] != null) {
|
||||
location.href = this.redirectUri + "?code=" + data["code"];
|
||||
if (this.redirectUri) {
|
||||
location.href = this.redirectUri + "?code=" + data["code"];
|
||||
} else {
|
||||
if (data['user'] && data['user']['access']) {
|
||||
sessionStorage.setItem('access', data['user']['access']);
|
||||
this.router.navigate(['dashboard'])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
error: (error) => {
|
||||
@@ -91,8 +99,15 @@ export class LoginComponent {
|
||||
.subscribe({
|
||||
next: (data) => {
|
||||
if (data["code"] != null) {
|
||||
window.localStorage.setItem("auth_sesion_key", data["session_key"]);
|
||||
location.href = this.redirectUri + "?code=" + data["code"];
|
||||
window.localStorage.setItem("auth_session_key", data["session_key"]);
|
||||
if (this.redirectUri) {
|
||||
location.href = this.redirectUri + "?code=" + data["code"];
|
||||
} else {
|
||||
if (data['user'] && data['user']['access']) {
|
||||
sessionStorage.setItem('access', data['user']['access']);
|
||||
this.router.navigate(['dashboard'])
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
error: (error) => {
|
||||
|
||||
Reference in New Issue
Block a user