I am attempting to enhance the user information in a single call. The process involves first signing up with a username and password on Auth0, followed by adding additional userinfo to the database during the callback phase. However, I am encountering difficulties with this process as the API is triggered even if the user already exists in the Auth0 database.
Below is the code snippet from AuthService:
public signup(signupForm, callback) {
const self = AuthService._instance;
var result = "";
self._angularAuth0.signup({
connection: "Users",
responseType: "token",
email: signupForm.email,
password: signupForm.password
}, (error) => {
console.log(error);
}, this.onSignupSuccess(signupForm));
}
private onSignupSuccess(form) {
const self = AuthService._instance;
const newUser = {
firstName: form.firstName,
lastName: form.lastName,
email: form.email,
birthdate: new Date(form.birthYear, form.birthMonth, form.birthDay),
auth0_UserId: this.userProfile.user_id,
gender: form.gender
};
self._dataService.add(this.baseUrl + "/users/", newUser);
}
In the app.ts file:
angularAuth0Provider.init({
clientID: "3LGkdfVvFfdsdfMpz1UVcwjh1jktrf7j",
domain: "somedomain.eu.auth0.com",
callbackURL: "http://127.0.0.1:8080/authorized",
});