feat(invite-system): implement user invite functionality with registration mode control
This commit is contained in:
@@ -28,8 +28,10 @@ export function AuthProvider({ children }) {
|
||||
return res.data.user;
|
||||
}, []);
|
||||
|
||||
const register = useCallback(async (username, displayName, email, password) => {
|
||||
const res = await api.post('/auth/register', { username, display_name: displayName, email, password });
|
||||
const register = useCallback(async (username, displayName, email, password, inviteToken) => {
|
||||
const payload = { username, display_name: displayName, email, password };
|
||||
if (inviteToken) payload.invite_token = inviteToken;
|
||||
const res = await api.post('/auth/register', payload);
|
||||
if (res.data.needsVerification) {
|
||||
return { needsVerification: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user