|
@@ -182,4 +182,25 @@ class LoginController extends Controller
|
|
|
|
|
|
return redirect()->route('login');
|
|
|
}
|
|
|
+
|
|
|
+ public function loginWithSessionKey($sessionKey, Request $request){
|
|
|
+ $url = "/session/pro_log_in_with_session_key/${sessionKey}";
|
|
|
+ $api = new Backend();
|
|
|
+ try {
|
|
|
+ $apiResponse = $api->post($url, []);
|
|
|
+ $data = json_decode($apiResponse->getContents());
|
|
|
+
|
|
|
+ if (!property_exists($data, 'success') || !$data->success) {
|
|
|
+ return redirect('/mc');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Cookie::queue('sessionKey', $data->data->sessionKey);
|
|
|
+
|
|
|
+ return redirect('/mc');
|
|
|
+
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return redirect('/mc');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|