2020-09-12 21:53:41 +00:00
|
|
|
import HTTPService from './HTTPService';
|
|
|
|
import { keyAttributes } from 'types';
|
2020-09-19 21:20:10 +00:00
|
|
|
import { getEndpoint } from 'utils/common/apiUtil';
|
2020-09-12 21:53:41 +00:00
|
|
|
|
2020-09-19 21:20:10 +00:00
|
|
|
const ENDPOINT = getEndpoint();
|
2020-09-14 09:32:01 +00:00
|
|
|
|
2020-09-12 21:53:41 +00:00
|
|
|
export const getOtt = (email: string) => {
|
2020-09-14 09:32:01 +00:00
|
|
|
return HTTPService.get(`${ENDPOINT}/users/ott`, { email })
|
2020-09-12 21:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const verifyOtt = (email: string, ott: string) => {
|
2020-09-14 09:32:01 +00:00
|
|
|
return HTTPService.get(`${ENDPOINT}/users/credentials`, { email, ott });
|
2020-09-12 21:53:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const putKeyAttributes = (token: string, keyAttributes: keyAttributes) => {
|
2020-09-14 09:32:01 +00:00
|
|
|
return HTTPService.put(`${ENDPOINT}/users/key-attributes`, keyAttributes, null, {
|
2020-09-12 21:53:41 +00:00
|
|
|
'X-Auth-Token': token,
|
|
|
|
});
|
|
|
|
}
|