me page update
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import authApi from "../../api/authApi";
|
import authService from "../../services/authService";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Info",
|
name: "Info",
|
||||||
@@ -31,10 +31,14 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
async beforeCreate() {
|
async beforeCreate() {
|
||||||
authApi.bind(this);
|
authService.session = authService.session.bind(this);
|
||||||
|
authService.banishIfUserUnAuthenticated = authService.banishIfUserUnAuthenticated.bind(this);
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
await authService.banishIfUserUnAuthenticated();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const {data} = await authApi.session();
|
const {data} = await authService.session();
|
||||||
this.user = data;
|
this.user = data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
await this.$router.replace("/auth/login");
|
await this.$router.replace("/auth/login");
|
||||||
|
|||||||
Reference in New Issue
Block a user