File tree Expand file tree Collapse file tree
server/controllers/user.controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ export function validateAndLoginUser(formProps: {
9292 } )
9393 ) ;
9494 dispatch ( justOpenedProject ( ) ) ;
95- browserHistory . push ( previousPath ) ;
95+ const path =
96+ previousPath === '/signup' || previousPath === '/login'
97+ ? '/'
98+ : previousPath ;
99+ browserHistory . push ( path ) ;
96100 resolve ( ) ;
97101 } )
98102 . catch ( ( error ) =>
@@ -123,7 +127,11 @@ export function validateAndSignUpUser(formValues: CreateUserRequestBody) {
123127 . then ( ( response ) => {
124128 dispatch ( authenticateUser ( response . data ) ) ;
125129 dispatch ( justOpenedProject ( ) ) ;
126- browserHistory . push ( previousPath ) ;
130+ const path =
131+ previousPath === '/signup' || previousPath === '/login'
132+ ? '/'
133+ : previousPath ;
134+ browserHistory . push ( path ) ;
127135 resolve ( ) ;
128136 } )
129137 . catch ( ( error ) => {
Original file line number Diff line number Diff line change @@ -71,7 +71,13 @@ export const createUser: RequestHandler<
7171 res . json ( userResponse ( user ) ) ;
7272 } catch ( mailErr ) {
7373 console . error ( mailErr ) ;
74- res . status ( 500 ) . json ( { error : 'Failed to send verification email.' } ) ;
74+ // In development, still return success so signup UX matches production
75+ // (redirect to home, user logged in). Email may be unconfigured locally.
76+ if ( process . env . NODE_ENV !== 'production' ) {
77+ res . json ( userResponse ( user ) ) ;
78+ } else {
79+ res . status ( 500 ) . json ( { error : 'Failed to send verification email.' } ) ;
80+ }
7581 }
7682 } ) ;
7783 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments