File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import Home from './components/Home';
9
9
import Nav from './components/Nav' ;
10
10
import LoginForm from './components/Auth/LoginForm.js' ;
11
11
import SignUpForm from './components/Auth/SignUpForm.js' ;
12
+ import Register from './components/Auth/Register.js' ;
12
13
import Coworking from './components/Coworking' ;
13
14
import Profile from './components/Profile' ;
14
15
import SubmitResource from './components/Resources/submitResource' ;
@@ -45,6 +46,9 @@ function App() {
45
46
< Route path = "/signup" >
46
47
< SignUpForm />
47
48
</ Route >
49
+ < Route path = "/register" >
50
+ < Register />
51
+ </ Route >
48
52
< Route
49
53
path = "/verify-email/:key"
50
54
render = { matchProps => < VerifyEmail matchProps = { matchProps } /> }
Original file line number Diff line number Diff line change @@ -12,11 +12,25 @@ const getResources = async searchTerm => {
12
12
return data ;
13
13
} ;
14
14
15
- const verifyEmail = async ( _key , apiKey ) => {
16
- const { data } = await axios . post ( `${ API_URL } /registration/verify-email` , {
17
- key : apiKey ,
15
+ const registerUser = async ( _key , user ) => {
16
+ const { username, password1, email, password2 } = user ;
17
+ const { data } = await axios . post ( `${ API_URL } /auth/registration` , {
18
+ username,
19
+ email,
20
+ password1,
21
+ password2,
18
22
} ) ;
19
23
return data ;
20
24
} ;
21
25
22
- export { getResource , getResources , verifyEmail } ;
26
+ const verifyEmail = async ( _key , apiKey ) => {
27
+ const { data } = await axios . post (
28
+ `${ API_URL } /auth/registration/verify-email` ,
29
+ {
30
+ key : apiKey ,
31
+ }
32
+ ) ;
33
+ return data ;
34
+ } ;
35
+
36
+ export { getResource , verifyEmail , registerUser } ;
You can’t perform that action at this time.
0 commit comments