File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ class ErrorBoundary extends React.Component {
77 // Display fallback UI
88 this . setState ( { hasError : true } )
99 // You can also log the error to an error reporting service
10- console . error ( error )
11- console . log ( info )
10+ console . error ( JSON . stringify ( error ) )
11+ console . log ( JSON . stringify ( info ) )
1212 }
1313
1414 public render ( ) {
Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ export const setAuthToken = (token: string | null) => {
77}
88
99export const authorizeHeaders = ( operation : Operation ) => {
10- operation . setContext ( {
11- headers : {
12- token : authToken
13- }
14- } )
10+ if ( authToken ) {
11+ operation . setContext ( {
12+ headers : {
13+ 'Authorization' : authToken
14+ }
15+ } )
16+ }
1517}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import channel from '../../../services/channel'
66
77export default {
88 authenticate : ( async ( context : CR . MachineContext ) : Promise < void > => {
9+
910 const result = await client . mutate ( {
1011 mutation : authenticateMutation ,
1112 variables : {
@@ -15,9 +16,10 @@ export default {
1516 }
1617 } )
1718
19+
1820 if ( ! result || ! result . data ) {
1921 // TODO: handle failed authentication
20- console . log ( 'unauthenticated ')
22+ console . error ( 'ERROR: Authentication failed ')
2123 }
2224 const { token} = result . data . editorLogin
2325 // add token to headers
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ import * as selectors from '../../selectors'
66export default {
77 setEnv : assign ( {
88 env : ( context : CR . MachineContext , event : CR . MachineEvent ) => {
9- return event . payload . env
9+ return {
10+ ...context . env ,
11+ ...event . payload . env
12+ }
1013 }
1114 } ) ,
1215 continueTutorial : assign ( {
You can’t perform that action at this time.
0 commit comments