Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 24cdf2dc authored by Akhil's avatar Akhil
Browse files

Set selected lang in session

parent 4ca5a738
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ return ['routes' => [
		'url' => '/issue/submit', 'verb' => 'POST'
	],
	
	['name' => 'account#index', 'url' => '/accounts/signup', 'verb' => 'GET'],
	['name' => 'account#index', 'url' => '/accounts/{lang}/signup', 'verb' => 'GET'],
	['name' => 'account#create', 'url' => '/accounts/create', 'verb' => 'POST'],
	['name' => 'account#captcha', 'url' => '/accounts/captcha', 'verb' => 'GET'],
	['name' => 'account#verify_captcha', 'url' => '/accounts/verify_captcha', 'verb' => 'POST'],
+4 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ class AccountController extends Controller {
	private $session;
	private $userSession;
	private $urlGenerator;
	private const SELECTED_LANGUAGE_KEY = 'selected_language';

	public function __construct(
		$AppName,
		IRequest $request,
@@ -62,6 +64,8 @@ class AccountController extends Controller {
		if ($this->userSession->isLoggedIn()) {
			return new RedirectResponse($this->urlGenerator->linkToDefaultPageUrl());
		}

		$this->session->set(self::SELECTED_LANGUAGE_KEY, $lang);
		return new TemplateResponse(
			Application::APP_ID,
			'signup',
+1 −1
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ export default {
			}
		},
		onLanguageChange() {
			window.location.href = `${window.location.origin}/apps/${APPLICATION_NAME}/accounts/signup?lang=${this.formData.selectedLanguage}`
			window.location.href = window.location.origin + '/apps/' + APPLICATION_NAME + '/accounts/' + this.formData.selectedLanguage + '/signup'
		},
	},
}