Closed fritzschoff closed 4 years ago
@jgrossrieder you were right with the createProfile function that it should only be called when it is a new user. Did some changes, have a look
@jgrossrieder you were right with the createProfile function that it should only be called when it is a new user. Did some changes, have a look
Awesome thank you! One question though: Where do we check if the login was successfull? I mean, if the user did enter some wrong credentials, I guess that you do not need to retrieve current profile?
@jgrossrieder Sth like the following should work.
async login() {
const formValue = this.loginForm.value,
email = formValue.email,
password = formValue.password;
try {
await this.authService.signin(email, password);
} catch (e) {
this.dialog.open(this.failedLoginDialog, {
data: {
message: e.message
}
});
}
}
@hakimio Okay my bad, I didn't know an exception was thrown. Perfect then.
@fritzschoff this PR causes TypeError: Cannot assign to read only property 'profile' of object
when creating new user. You can not do the following:
this.store.update(state => state.profile = profile);
it should be:
this.store.update(state => ({profile}));
but, to be honest, I don't understand what's wrong with just this.store.update({profile});
?
his.store.update({profile})
that is causing a type error. Will check with your suggestion
Just type-cast? this.store.update(<WhateverTypeItShouldBe>{profile});
resolves #144