always subscribe to newsletter

This commit is contained in:
Andras Schmelczer 2026-05-05 22:16:07 +01:00
parent 7c36cbfdd4
commit 48983e3b4b

View file

@ -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) {