pass browser locale to api/runners/register/

ref #32
This commit is contained in:
Philipp Dormann 2021-04-01 18:31:18 +02:00
parent 9b62962758
commit e3f7497af5
1 changed files with 3 additions and 2 deletions

View File

@ -320,9 +320,10 @@ 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 }) => {