mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
Testing login backend
This commit is contained in:
parent
5df28e0e77
commit
8de496826a
@ -4,6 +4,13 @@ const { admin, db } = require('./admin');
|
|||||||
// The function will only execute if the user is logged in, or rather, they have
|
// The function will only execute if the user is logged in, or rather, they have
|
||||||
// a valid token
|
// a valid token
|
||||||
module.exports = (req, res, next) => {
|
module.exports = (req, res, next) => {
|
||||||
|
console.log(req);
|
||||||
|
console.log(req.body);
|
||||||
|
console.log(req.headers);
|
||||||
|
console.log(req.headers.authorization);
|
||||||
|
console.log(JSON.stringify(req.body));
|
||||||
|
console.log(JSON.stringify(req.header));
|
||||||
|
|
||||||
let idToken;
|
let idToken;
|
||||||
|
|
||||||
// Checking that the token exists in the header of the request
|
// Checking that the token exists in the header of the request
|
||||||
|
|||||||
@ -37,5 +37,5 @@
|
|||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"proxy": "https://us-central1-twistter-e4649.cloudfunctions.net/api"
|
"proxy": " http://localhost:5001/twistter-e4649/us-central1/api"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,6 +85,7 @@ export class edit extends Component {
|
|||||||
axios
|
axios
|
||||||
.post("/updateProfileInfo", newProfileData)
|
.post("/updateProfileInfo", newProfileData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: false
|
loading: false
|
||||||
});
|
});
|
||||||
@ -92,6 +93,7 @@ export class edit extends Component {
|
|||||||
// TODO: Need to redirect user to their profile page
|
// TODO: Need to redirect user to their profile page
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
this.setState({
|
this.setState({
|
||||||
errors: err.response.data,
|
errors: err.response.data,
|
||||||
loading: false
|
loading: false
|
||||||
|
|||||||
@ -23,13 +23,13 @@ export const loginUser = (loginData, history) => (dispatch) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getProfileInfo = () => (dispatch) => {
|
// export const getProfileInfo = () => (dispatch) => {
|
||||||
axios.get('/getProfileInfo')
|
// axios.get('/getProfileInfo')
|
||||||
.then((res) => {
|
// .then((res) => {
|
||||||
dispatch({
|
// dispatch({
|
||||||
type: SET_USER,
|
// type: SET_USER,
|
||||||
payload: res.data,
|
// payload: res.data,
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
.catch((err) => console.error(err));
|
// .catch((err) => console.error(err));
|
||||||
}
|
// }
|
||||||
Loading…
Reference in New Issue
Block a user