login
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// @import url('https://fonts.googleapis.com/css?family=Raleway:400,700');
|
@import url('https://fonts.googleapis.com/css?family=Raleway:400,700');
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@@ -40,14 +40,19 @@ export class LoginComponent {
|
|||||||
this.http.post(environment.api_url + 'auth/login-with-session-id', {
|
this.http.post(environment.api_url + 'auth/login-with-session-id', {
|
||||||
code: id,
|
code: id,
|
||||||
client_id: this.client_id
|
client_id: this.client_id
|
||||||
}).subscribe({
|
}).pipe(
|
||||||
|
this.toast.observe({
|
||||||
|
loading: 'Logging in...',
|
||||||
|
success: 'Logged in',
|
||||||
|
error: 'Invalid session, please log in with'
|
||||||
|
})
|
||||||
|
).subscribe({
|
||||||
next: (data) => {
|
next: (data) => {
|
||||||
if (data["code"] != null) {
|
if (data["code"] != null) {
|
||||||
location.href = this.redirectUri + "?code=" + data["code"];
|
location.href = this.redirectUri + "?code=" + data["code"];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
this.toast.error('Invalid session, please log in with your credentials');
|
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user