always subscribe to newsletter
This commit is contained in:
parent
7c36cbfdd4
commit
48983e3b4b
1 changed files with 5 additions and 1 deletions
|
|
@ -69,6 +69,7 @@ export function useAuth() {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
passwordConfirm: password,
|
passwordConfirm: password,
|
||||||
|
newsletter: true,
|
||||||
});
|
});
|
||||||
// Auto-login after registration
|
// Auto-login after registration
|
||||||
const result = await pb.collection('users').authWithPassword(email, password);
|
const result = await pb.collection('users').authWithPassword(email, password);
|
||||||
|
|
@ -87,7 +88,10 @@ export function useAuth() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
const result = await pb.collection('users').authWithOAuth2({ provider });
|
const result = await pb.collection('users').authWithOAuth2({
|
||||||
|
provider,
|
||||||
|
createData: { newsletter: true },
|
||||||
|
});
|
||||||
setUser(recordToUser(result.record));
|
setUser(recordToUser(result.record));
|
||||||
trackEvent('Login', { method: provider });
|
trackEvent('Login', { method: provider });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue