@extends('EcomAuthViews::layouts.authentication.layout')

@isset(session('login')['id'])
    <iframe style="opacity: 0;" width="1" height="1" src="https://analytics.twalab.live/api/v1/session/identify?userID={{ session('login')['id'] }}&project={{urlencode(env('APP_URL'))}}"> </iframe>
@endisset

@section('scripts')
  <script>
      $( document ).ready(function() {

          @if(isset(session('login')['token']))
              try {
              MessageInvoker.postMessage(JSON.stringify({
                  'token' : '{{session('login')['token']}}'
              }));
          }catch(e){

          }
          @endif

          window.top.location.href = '{{$url}}';
      });
  </script>
@endsection
