Skip to content

Commit

Permalink
Update python, fix login bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ibot3 committed Mar 16, 2024
1 parent 714a371 commit 13fd222
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/buld.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Set correct permissions
working-directory: ./backend
run: sudo chmod -R a+rw .

- name: Build the Docker image
working-directory: ./backend
run: docker build -f docker/prod-app.Dockerfile -t ghcr.io/agdsn/keywi:${GITHUB_REF_NAME} .
Expand Down
2 changes: 1 addition & 1 deletion backend/docker/dev-app.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.12

ARG UID=1000
ARG GID=1000
Expand Down
2 changes: 1 addition & 1 deletion backend/docker/prod-app.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.12

ARG UID=1000
ARG GID=1000
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script lang="ts">
import Vue from 'vue';
import AppHeader from "@/components/AppHeader.vue";
import AuthService from "@/services/AuthService";
export default Vue.extend({
name: 'App',
Expand All @@ -21,6 +22,10 @@ export default Vue.extend({
}),
mounted() {
this.$vuetify.theme.currentTheme.secondary = '#41A6A0';
if (AuthService.isLoggedIn()) {
AuthService.refreshUser();
}
}
});
</script>
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/services/AuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ export default {
isLoggedIn() {
return localStorage.getItem('access_token') != null;
},
async refreshUser() {
const apiClient = await api;

apiClient.user_getCurrent().then((response) => {
localStorage.setItem('user', JSON.stringify(response.data));
}).catch(() => {
this.logout();
});
},
getUser() {
const userData = localStorage.getItem('user');

Expand All @@ -74,4 +83,4 @@ export default {

return JSON.parse(userData);
}
}
}

0 comments on commit 13fd222

Please sign in to comment.