parent
79d8545ed6
commit
a39cf75c7f
|
@ -187,8 +187,11 @@ const state = reactive({
|
|||
activetab: "profile",
|
||||
})
|
||||
const toast = useToast();
|
||||
const token = location.hash.substr(1).split('&')[0].split('=')[1];
|
||||
axios.get(`${config.baseurl}api/runners/me/${token}`)
|
||||
const props = defineProps({
|
||||
token: String
|
||||
})
|
||||
const accesstoken = atob(props.token);
|
||||
axios.get(`${config.baseurl}api/runners/me/${accesstoken}`)
|
||||
.then(({ data }) => {
|
||||
state.phone = data.phone;
|
||||
state.email = data.email;
|
||||
|
@ -199,7 +202,7 @@ axios.get(`${config.baseurl}api/runners/me/${token}`)
|
|||
}).catch((error) => {
|
||||
toast.error("An error occured while loading your profile data");
|
||||
})
|
||||
axios.get(`${config.baseurl}api/runners/me/${token}/scans`)
|
||||
axios.get(`${config.baseurl}api/runners/me/${accesstoken}/scans`)
|
||||
.then(({ data }) => {
|
||||
data.map(function(s) {
|
||||
s.lapTime = Math.floor(s.lapTime / 60) + 'min ' + (Math.floor(s.lapTime % 60) + "").padStart(2, "0") + "s"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
v-if="state.org_name !== ''"
|
||||
class="mx-auto leading-relaxed text-base text-center"
|
||||
>Organization: {{ state.org_name }}</p>
|
||||
<p v-else class="mx-auto leading-relaxed text-base text-center">Bürgerlauf</p>
|
||||
<div class="mt-4">
|
||||
<label for="first_name" class="block font-medium">
|
||||
{{ $t('vorname') }}
|
||||
|
@ -234,6 +235,7 @@ const props = defineProps({
|
|||
token: String
|
||||
})
|
||||
if (props.token) {
|
||||
props.token = atob(props.token);
|
||||
axios.get(`${config.baseurl}api/organizations/selfservice/${props.token}`)
|
||||
.then(({ data }) => {
|
||||
console.log(data);
|
||||
|
@ -281,10 +283,9 @@ function login() {
|
|||
toast("registration in progress...");
|
||||
axios.post(`${config.baseurl}api/runners/register`, postdata)
|
||||
.then(({ data }) => {
|
||||
const token = data.token;
|
||||
const userid = JSON.parse(atob(token.split(".")[1])).id;
|
||||
console.log({ token });
|
||||
console.log({ userid });
|
||||
const token = btoa(data.token);
|
||||
// const userid = JSON.parse(atob(token.split(".")[1])).id;
|
||||
location.replace("../profile/" + token)
|
||||
//
|
||||
toast.success("You have been registered!");
|
||||
})
|
||||
|
|
|
@ -37,7 +37,7 @@ if (typeof config !== 'undefined') {
|
|||
{ path: '/privacy', component: Privacy },
|
||||
{ path: '/register', component: Register },
|
||||
{ path: '/register/:token', component: Register, props: true },
|
||||
{ path: '/profile', component: Profile }
|
||||
{ path: '/profile/:token', component: Profile, props: true }
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue