@@ -8,7 +8,7 @@ import { Form as AntdForm, Icon, Button, Alert, Row, Col } from 'antd';
88import { SignupSchema } from './validations' ;
99import { AntInput } from '../../AntDesignFields' ;
1010import { hasValidObjectValues } from '../../../utils/objectUtils' ;
11- import { setAuthToken } from '../../../utils/userUtils' ;
11+ import { setAuthToken , setRefreshToken } from '../../../utils/userUtils' ;
1212import { CREATE_ACCOUNT , SEND_ONBOARDING_CODE } from '../../../apollo/mutations/user' ;
1313
1414interface IRegistrationFormProps extends RouteComponentProps {
@@ -30,7 +30,10 @@ interface IRegistrationFormState {
3030
3131interface ICreateAccountResult {
3232 data : {
33- createAccount : { token : string } ,
33+ createAccount : {
34+ accessToken : string ,
35+ refreshToken : string ,
36+ } ,
3437 }
3538}
3639
@@ -68,11 +71,12 @@ class RegistrationForm extends React.Component<
6871 } )
6972 . then ( async ( { data } : ICreateAccountResult ) => {
7073 const { createAccount } = data ;
71- const { token : userToken } = createAccount ;
72- setAuthToken ( userToken ) ;
74+ const { accessToken, refreshToken } = createAccount ;
75+ setAuthToken ( accessToken ) ;
76+ setRefreshToken ( refreshToken ) ;
7377 await client . mutate ( {
7478 mutation : SEND_ONBOARDING_CODE ,
75- variables : { token : userToken } ,
79+ variables : { token : accessToken } ,
7680 } ) ;
7781 this . setState ( { isLoading : false } ) ;
7882 history . replace ( '/register/verify-email' ) ;
0 commit comments