wip forgot password
This commit is contained in:
parent
15af2d7469
commit
1361e76e7d
|
|
@ -5,7 +5,7 @@ import Login from './Login';
|
|||
// import Start from './Start';
|
||||
// import Logout from './Logout';
|
||||
// import Registration from './Registration';
|
||||
// import ForgetPassword from './ForgetPassword';
|
||||
import ForgetPassword from './ForgetPassword';
|
||||
// import PasswordReset from './PasswordReset';
|
||||
// import ConfirmMail from './ConfirmMail';
|
||||
// import LockScreen from './LockScreen';
|
||||
|
|
@ -13,10 +13,11 @@ import Login from './Login';
|
|||
const AuthBasicRoutes = ({ match: { url } }) => (
|
||||
<Switch>
|
||||
<Route path={`${url}/login`} exact component={Login} />
|
||||
<Route path={`${url}/forget-password`} exact component={ForgetPassword} />
|
||||
{/* <Route path={`${url}/start`} exact component={Start} />
|
||||
<Route path={`${url}/logout`} exact component={Logout} />
|
||||
<Route path={`${url}/register`} exact component={Registration} />
|
||||
<Route path={`${url}/forget-password`} exact component={ForgetPassword} />
|
||||
|
||||
<Route path={`${url}/confirm-mail`} exact component={ConfirmMail} />
|
||||
<Route path={`${url}/password-reset`} exact component={PasswordReset} />
|
||||
<Route path={`${url}/lock-screen`} exact component={LockScreen} /> */}
|
||||
|
|
|
|||
|
|
@ -298,6 +298,17 @@ export const requestPasswordReset = userId => {
|
|||
});
|
||||
};
|
||||
|
||||
export const resetPassword = (userId, email) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
apiFetch(`/users/${userId}/reset_password`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ email })
|
||||
})
|
||||
.then(response => resolve(response))
|
||||
.catch(error => reject(error));
|
||||
});
|
||||
};
|
||||
|
||||
export const postUserAppInteraction = (userId, options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
apiFetch(`/users/${userId}/app_interactions`, {
|
||||
|
|
|
|||
|
|
@ -407,6 +407,7 @@ Rails.application.routes.draw do
|
|||
match '/users/authorizations/google' => 'api_users#google_auth', :via => :get
|
||||
match '/users/:id/set_password' => 'api_users#set_password', :via => :post
|
||||
match '/users/:id/request_reset_password' => 'api_users#request_reset_password', :via => :post
|
||||
match '/users/:id/reset_password' => 'api_users#reset_password', :via => :post
|
||||
match '/users/:id/app_interactions' => 'api_users#post_app_interactions', :via => :post
|
||||
|
||||
match '/reviews' => 'api_reviews#index', :via => :get
|
||||
|
|
|
|||
Loading…
Reference in New Issue