private async Task LoginWithDeviceAuth(DeviceAuth auth)
        {
            Login login = this;

            try
            {
                await AuroraAuth.DeviceAuthLogin(auth);

                new Aurora.Launcher.Windows.Launcher().Show();
                login.Close();
            }
            catch (Exception ex)
            {
                login.SetLoggingIn();
            }
        }
        private async void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            Login login = this;

            login.SetLoggingIn(true);
            try
            {
                await AuroraAuth.Login(login.EmailField.Text, login.PasswordField.Password);

                await AuroraAuth.CreateDeviceAuth();

                new Aurora.Launcher.Windows.Launcher().Show();
                login.Close();
            }
            catch (Exception ex)
            {
                login.SetLoggingIn();
                login.LoginFailedLabel.Content    = ex.Message == "Invalid credentials!" ? (object)Resources.InvalidCredentialsText : (ex.Message == "Unknown exception occurred!" ? (object)Resources.UnknownExceptionText : (object)Resources.FailedToConnectText);
                login.LoginFailedLabel.Visibility = Visibility.Visible;
            }
        }
Beispiel #3
0
        private async void LaunchButton_Click(object sender, RoutedEventArgs e)
        {
            Aurora.Launcher.Windows.Launcher launcher = this;
            string arguments = "-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -skippatchcheck -AUTH_TYPE=exchangecode -AUTH_LOGIN=unused ";
            int    num       = 0;
            object obj;

            try
            {
                arguments = arguments + "-AUTH_PASSWORD="******" ";
            }
            catch (Exception ex)
            {
                obj = (object)ex;
                num = 1;
            }
            if (num == 1)
            {
                Exception     exception     = (Exception)obj;
                ContentDialog contentDialog = new ContentDialog();
                contentDialog.set_Title((object)Resources.ExceptionOccurredText);
                ((ContentControl)contentDialog).Content = exception.Message == "Invalid credentials!" ? (object)Resources.InvalidCredentialsText : (exception.Message == "Unknown exception occurred!" ? (object)Resources.UnknownExceptionText : (object)Resources.FailedToConnectText);
                contentDialog.set_CloseButtonText(Resources.ExitButtonText);
                ContentDialogResult contentDialogResult = await contentDialog.ShowAsync();

                new Login().Show();
                launcher.Close();
                arguments = (string)null;
            }
            else
            {
                obj        = (object)null;
                arguments += "-noeac -fromfl=be -fltoken=f7b9gah4h5380d10f721dd6a";
                if (!File.Exists(Path.Combine(AuroraConfig.Get()?.Path ?? "", "FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe")))
                {
                    ContentDialog contentDialog = new ContentDialog();
                    contentDialog.set_Title((object)Resources.ExceptionOccurredText);
                    ((ContentControl)contentDialog).Content = (object)("\"FortniteClient-Win64-Shipping.exe\" " + Resources.InvalidPathErrorText);
                    contentDialog.set_CloseButtonText(Resources.ExitButtonText);
                    ContentDialogResult contentDialogResult = await contentDialog.ShowAsync();

                    arguments = (string)null;
                }
                else
                {
                    launcher.SetHide();
                    await launcher._launcher.StartGame(arguments);

                    try
                    {
                        await AuroraAuth.RefreshToken();
                    }
                    catch
                    {
                        AuroraConfig.SaveDeviceAuth((DeviceAuth)null);
                        Globals.AuthData = (OAuthToken)null;
                        new Login().Show();
                        launcher.Close();
                    }
                    launcher.SetShow();
                    arguments = (string)null;
                }
            }
        }