diff --git a/components/Account.vue b/components/Account.vue new file mode 100644 index 00000000..ad8c67ee --- /dev/null +++ b/components/Account.vue @@ -0,0 +1,71 @@ + + + diff --git a/components/Alert.vue b/components/Alert.vue new file mode 100644 index 00000000..983a5cfd --- /dev/null +++ b/components/Alert.vue @@ -0,0 +1,17 @@ + + + diff --git a/components/Login.vue b/components/Login.vue new file mode 100644 index 00000000..ef0ada9b --- /dev/null +++ b/components/Login.vue @@ -0,0 +1,106 @@ + + + diff --git a/locale/pl/translations.suml b/locale/pl/translations.suml index caf00045..7e7dded6 100644 --- a/locale/pl/translations.suml +++ b/locale/pl/translations.suml @@ -596,7 +596,17 @@ user: code: action: 'Sprawdź' invalid: 'Kod nieprawidłowy.' - + account: + changeUsername: + header: 'Nazwa użytkownika' + action: 'Zmień' + invalid: 'Nazwa użytkownika musi mieć od 4 do 16 znaków i zawierać wyłącznie cyfry, litery, kropkę, myślnik i podłogę.' + taken: 'Ta nazwa użytkownika jest zajęta.' + changeEmail: + header: 'Adres email' + action: 'Zmień' + admin: 'Adminię' + logout: 'Wyloguj' share: 'Udostępnij' diff --git a/plugins/auth.js b/plugins/auth.js index 952e8de0..0cfe8787 100644 --- a/plugins/auth.js +++ b/plugins/auth.js @@ -1,3 +1,6 @@ +import Vue from 'vue'; +import t from "../src/translator"; + export default ({app, store}) => { const token = app.$cookies.get('token'); if (token) { @@ -6,4 +9,11 @@ export default ({app, store}) => { app.$cookies.removeAll(); } } + + Vue.prototype.$user = _ => store.state.user; + Vue.prototype.$auth = _ => { + return store.state.token ? { + authorization: 'Bearer ' + store.state.token, + } : {}; + }; } diff --git a/routes/user.vue b/routes/user.vue index 8c66a109..f4f8605b 100644 --- a/routes/user.vue +++ b/routes/user.vue @@ -5,129 +5,15 @@ user.headerLong -
-
-

- - {{error}} -

-
- -
- Logged in as @{{$store.state.user.username}}. - - -
-
-
-
- -
- -
-
-
-
-
-
-

- - user.login.emailSent -

-
- -
-
- -
- -
-
-
-
-
+ +