Merge pull request 'feature/32-registration-language' (#33) from feature/32-registration-language into dev
continuous-integration/drone/push Build was killed Details

Reviewed-on: #33
close #32
This commit is contained in:
Philipp Dormann 2021-04-01 16:38:49 +00:00
commit e796f6dcaf
1 changed files with 5 additions and 5 deletions

View File

@ -261,8 +261,6 @@ import isEmail from 'validator/es/lib/isEmail';
import isMobilePhone from 'validator/es/lib/isMobilePhone';
import isPostalCode from 'validator/es/lib/isPostalCode';
import { useToast } from "vue-toastification";
// import { router } from '../router';
import { i18n } from '../language';
const props = defineProps({
token: String
@ -320,14 +318,16 @@ function login() {
postdata.team = org_team.value;
}
toast("registration in progress...");
let url = `${config.baseurl}api/runners/register`;
const browserlocale = ((navigator.languages && navigator.languages[0]) || '').substr(0, 2);
let url = `${config.baseurl}api/runners/register/?locale=${browserlocale}`;
if (props.token) {
url = `${config.baseurl}api/runners/register/${props.token}`
url = `${config.baseurl}api/runners/register/${props.token}/?locale=${browserlocale}`
}
axios.post(url, postdata)
.then(({ data }) => {
const token = btoa(data.token);
// router.push(`${config.baseurl_selfservice}/profile/${token}`);
// alert(token);
location.replace(`${config.baseurl_selfservice}profile/${token}`);
})
.catch((error) => {
console.log(error);