File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ export default {
84
84
$alertStore . success ( `Welcome ${ user . username } , you have successfully registered!` )
85
85
socketLogin ( user )
86
86
}
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 )
90
97
} ) . catch ( ( ) => { } )
91
98
92
99
// Reauthenticate on app init if token is present
@@ -100,7 +107,8 @@ export default {
100
107
reauthenticate,
101
108
login,
102
109
logout,
103
- register
110
+ register,
111
+ confirmRegistration
104
112
} )
105
113
} ,
106
114
render ( ) { return this . $slots . default ( ) } // renderless component
You can’t perform that action at this time.
0 commit comments