瀏覽代碼

some auth refactoring

Alex 5 年之前
父節點
當前提交
99819f3e3c
共有 4 個文件被更改,包括 21 次插入5 次删除
  1. 2 2
      src/actions/auth.js
  2. 1 0
      src/components/signIn.js
  3. 1 0
      src/components/signUp.js
  4. 17 3
      src/utils/formFields.js

+ 2 - 2
src/actions/auth.js

@@ -21,7 +21,7 @@ export const auth = payload => {
     return async dispatch => {
         dispatch(authRequest());
         try {
-            const { data } = await axios.post("http://subdomain.entony.fs.a-level.com.ua/api/auth/login", payload);
+            const { data } = await axios.post("https://api-clinics.herokuapp.com/api/v1/auth/login", payload);
             console.log('data',data)
             dispatch(authRequestSuccess(data));
         } catch (error){
@@ -50,7 +50,7 @@ export const register = payload => {
         dispatch(registerRequest());
         try {
             const { data } = await axios.post(
-                "http://subdomain.entony.fs.a-level.com.ua/api/auth/register",
+                "https://api-clinics.herokuapp.com/api/v1/auth/register",
                 payload
             );
            

+ 1 - 0
src/components/signIn.js

@@ -33,6 +33,7 @@ export const SignInForm = ({ error, submitHandler }) => {
 							onChange={onChangeHandler}
 							onFocus={focusEvent}
 							onBlur={blurEvent}
+							autoComplete="off"
 						/>
 					);
 				})}

+ 1 - 0
src/components/signUp.js

@@ -33,6 +33,7 @@ export const SignUpForm = ({ submitHandler, error, successRegister }) => {
 							onChange={onChangeHandler}
 							onFocus={focusEvent}
 							onBlur={blurEvent}
+							autoComplete="off"
 						/>
 					);
 				})}

+ 17 - 3
src/utils/formFields.js

@@ -72,7 +72,7 @@ export const signUpForm = {
 			id: 3,
 			type: "text",
 			name: "lastName",
-			label: "First Name",
+			label: "Last Name",
 			validation: {
 				requred: {
 					cb: v => v.trim() === ""
@@ -82,8 +82,22 @@ export const signUpForm = {
 			touch: false,
 			value: ""
 		},
-		password: {
+		phone: {
 			id: 4,
+			type: "number",
+			name: "phone",
+			label: "Phone",
+			validation: {
+				requred: {
+					cb: v => v.trim() === ""
+				}
+			},
+			fail: false,
+			touch: false,
+			value: ""
+		},
+		password: {
+			id: 5,
 			name: "password",
 			type: "password",
 			label: "Password",
@@ -100,7 +114,7 @@ export const signUpForm = {
 			value: ""
 		},
 		confirmPassword: {
-			id: 5,
+			id: 6,
 			name: "confirmPassword",
 			type: "password",
 			label: "Confirm Password",