accounts-frontend/packages/app/services/api/signup.ts

34 lines
707 B
TypeScript
Raw Normal View History

import request from 'app/services/request';
2016-07-28 10:33:30 +05:30
2019-12-07 16:58:52 +05:30
import { OAuthResponse } from './authentication';
2016-07-28 10:33:30 +05:30
export default {
register({
email = '',
username = '',
password = '',
rePassword = '',
rulesAgreement = false,
lang = '',
captcha = '',
}) {
return request.post(
'/api/signup',
{ email, username, password, rePassword, rulesAgreement, lang, captcha },
{ token: null },
);
},
2016-07-28 10:33:30 +05:30
activate({ key = '' }) {
2019-12-07 16:58:52 +05:30
return request.post<OAuthResponse>(
'/api/signup/confirm',
{ key },
{ token: null },
);
},
2016-07-28 10:33:30 +05:30
resendActivation({ email = '', captcha }) {
return request.post('/api/signup/repeat-message', { email, captcha });
},
2016-07-28 10:33:30 +05:30
};