File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ export default {
8484 $alertStore . success ( `Welcome ${ user . username } , you have successfully registered!` )
8585 socketLogin ( user )
8686 }
87- else return true
88- // TODO(akinsey): implement flow for when email confirmation is enabled
89- // else {}
87+ else return true // when email confirmation is enabled, tell modal to show confirmation msg
88+ } ) . catch ( ( ) => { } )
89+
90+ const confirmRegistration = ( username , token ) => authApi . confirmRegistration ( { username, token } )
91+ . then ( dbUser => {
92+ $appCache . set ( AUTH_KEY , dbUser )
93+ Object . assign ( user , dbUser )
94+ $prefs . fetch ( )
95+ $alertStore . success ( `Welcome ${ user . username } , you have successfully registered!` )
96+ socketLogin ( user )
9097 } ) . catch ( ( ) => { } )
9198
9299 // Reauthenticate on app init if token is present
@@ -100,7 +107,8 @@ export default {
100107 reauthenticate,
101108 login,
102109 logout,
103- register
110+ register,
111+ confirmRegistration
104112 } )
105113 } ,
106114 render ( ) { return this . $slots . default ( ) } // renderless component
You can’t perform that action at this time.
0 commit comments