debugging cookies w/ burnettk

This commit is contained in:
jasquat 2023-01-11 14:52:12 -05:00
parent 11efb5ec43
commit 1a12b7ac83
3 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,6 @@
const { port, hostname } = window.location;
console.log('START');
console.log('window.location', window.location);
let hostAndPort = `api.${hostname}`;
let protocol = 'https';
@ -10,12 +12,14 @@ if (/^\d+\./.test(hostname) || hostname === 'localhost') {
hostAndPort = `${hostname}:${serverPort}`;
protocol = 'http';
}
protocol = 'http';
let url = `${protocol}://${hostAndPort}/v1.0`;
// Allow overriding the backend base url with an environment variable at build time.
console.log('OUR URL', url);
if (process.env.REACT_APP_BACKEND_BASE_URL) {
url = process.env.REACT_APP_BACKEND_BASE_URL;
}
console.log('NO THIS ONE', url);
export const BACKEND_BASE_URL = url;

View File

@ -184,6 +184,13 @@ export default function TaskShow() {
);
}
function customValidate(formData: any, errors: any) {
if (formData.pass1 !== formData.pass2) {
errors.pass2.addError("Passwords don't match");
}
return errors;
}
return (
<Grid fullWidth condensed>
<Column md={5} lg={8} sm={4}>
@ -193,6 +200,7 @@ export default function TaskShow() {
schema={jsonSchema}
uiSchema={formUiSchema}
validator={validator}
customValidate={customValidate}
>
{reactFragmentToHideSubmitButton}
</Form>

View File

@ -21,6 +21,7 @@ const getCurrentLocation = () => {
const doLogin = () => {
const url = `${BACKEND_BASE_URL}/login?redirect_url=${getCurrentLocation()}`;
console.log('URL', url);
window.location.href = url;
};
const getIdToken = () => {
@ -77,6 +78,7 @@ const getAuthTokenFromParams = () => {
localStorage.setItem('jwtIdToken', idToken);
}
// window.location.href = `${getCurrentLocation(queryParams.toString())}`;
console.log('THE PALCE: ', `${getCurrentLocation()}`);
window.location.href = `${getCurrentLocation()}`;
} else if (!isLoggedIn()) {
doLogin();