- test of spid login;
This commit is contained in:
@@ -9,13 +9,17 @@ import { storeSet, useStore } from '../../store';
|
||||
// components
|
||||
import LogoIcon from '../../icons/LogoIcon';
|
||||
import { Messages } from 'primereact/messages';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
const API_BASE_URL = process.env.REACT_APP_API_EXECUTION_ADDRESS;
|
||||
|
||||
const Login = () => {
|
||||
const token = useStore().main.token();
|
||||
const errorMsgs = useRef(null);
|
||||
let { temp_token } = useParams();
|
||||
|
||||
const loginWithSpid = () => {
|
||||
console.log('spid')
|
||||
window.location.replace(`${API_BASE_URL}/saml2/authenticate/loginumbria`);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -24,6 +28,10 @@ const Login = () => {
|
||||
}
|
||||
}, [token]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('temp_token', temp_token)
|
||||
}, [temp_token]);
|
||||
|
||||
return (
|
||||
<div className={classNames(['appPage', 'appPageLogin'])}>
|
||||
<div className="appPageLogin__wrapper">
|
||||
|
||||
53
src/pages/Profile/index.js
Normal file
53
src/pages/Profile/index.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { is } from 'ramda';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
|
||||
// components
|
||||
import { Messages } from 'primereact/messages';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
|
||||
const Profile = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const { id } = useParams();
|
||||
const [data, setData] = useState({});
|
||||
const infoMsgs = useRef(null);
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
//setData(getFormattedBandiData(data.data));
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
const errGetCallback = (data) => {
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
//BandoService.getBando(bandoId, getCallback, errGetCallback);
|
||||
}, [id]);
|
||||
|
||||
return (
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
<h1>{data.name}</h1>
|
||||
<p>
|
||||
{__('Profilo utente', 'gepafin')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="appPage__spacer"></div>
|
||||
<Messages ref={infoMsgs}/>
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
export default Profile;
|
||||
@@ -3,6 +3,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { classNames } from 'primereact/utils';
|
||||
import { isEmpty } from 'ramda';
|
||||
import { useParams } from 'react-router-dom';
|
||||
|
||||
// api
|
||||
import AuthenticationService from '../../service/authentication-service';
|
||||
@@ -23,6 +24,7 @@ const Registration = () => {
|
||||
const token = useStore().main.token();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const errorMsgs = useRef(null);
|
||||
let { temp_token } = useParams();
|
||||
const {
|
||||
control,
|
||||
handleSubmit,
|
||||
@@ -73,6 +75,10 @@ const Registration = () => {
|
||||
}
|
||||
}, [token]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('temp_token', temp_token)
|
||||
}, [temp_token]);
|
||||
|
||||
return (
|
||||
<div className={classNames(['appPage', 'appPageLogin'])}>
|
||||
<div className="appPageLogin__wrapper">
|
||||
|
||||
Reference in New Issue
Block a user