Skip to content

Commit 2e1a6df

Browse files
committed
store more data after user logs in
1 parent d2d2557 commit 2e1a6df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/views/auth/SignIn.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export default {
6161
const response = await this.signInUser(this.formData);
6262
setAccessToken(response.data.return.access_token);
6363
setRefreshToken(response.data.return.refresh_token);
64-
await this.$store.dispatch('login', this.getUserFromJwt(response.data.return.access_token));
64+
const userId = this.getUserFromJwt(response.data.return.access_token).id;
65+
const user = await this.$http.get(`/users/${userId}`);
66+
await this.$store.dispatch('login', user.data);
6567
if (response.data.return.is_profile_completed) {
6668
this.$router.push('/browse');
6769
} else {

0 commit comments

Comments
 (0)