UWP app crashes when not in debugging mode
<p><strong>What I'm trying to do:</strong></p>

<p>For the UWP app that I'm developing, I'm requiring the users to login with their Google/FB credentials to access the features of the app. To do this, I'm using an Auth0 client for OAuth authentication. On successful login, the user should be navigated to MainPage.xaml. When debugging the app, this works perfectly with no problems at all.</p>

<p>XAML:</p>

<pre><code>&lt;Button Margin="0,45,0,0" Grid.Row="6" HorizontalAlignment="Center" Name="GoogleSignIn" Content="Sign in with Google+" Tag="google-oauth2" Click="OAuthSignin" /&gt;
&lt;Button Margin="0,15,0,0" Grid.Row="7" HorizontalAlignment="Center" Name="FacebookSignIn" Content="Sign in with Facebook" Tag="facebook" Click="OAuthSignin" /&gt;
</code></pre>

<p>Code-behind:</p>

<pre><code>private async void OAuthSignin(object sender, RoutedEventArgs e)
{
    string oauthprovider = ((Button)sender).Tag.ToString();
    try
        {
            Auth0User user = await App.auth0.LoginAsync(oauthprovider);

            if (user != null)
            {
                //Add user to credential locker
            }
        }
        catch(Exception ex)
        {
            ex.ToString();
        }
        finally
        {
            var nav = Template10.Common.BootStrapper.Current.NavigationService;
            nav.Navigate(typeof(Views.MainPage));
            nav.ClearHistory();
        }
}
</code></pre>

<p><strong>What's going wrong:</strong></p>

<p>Since the app gets deployed to the emulator, I stop debugging and launch the app by tapping the tile. I get to the login page, enter my credentials. As soon as I hit enter, I see it returning back to the login page and crashing soon after. If I re-open the app this point, I see that I'm already logged in and it takes me directly to MainPage.xaml (as is the logic of the app)</p>

<p><strong>What concerns me:</strong> Why is it behaving differently when not in debug mode? This handicaps me because I can't put a breakpoint to determine what caused the crash.</p>

<p>Any input would be greatly appreciated.</p>

<p>P.S: I've tried deploying the app to me Lumia 640 and I see the same problem on the phone as well (meaning to say it's not emulator related). The desktop version works fine (even outside of debugging).</p>