Beispiel #1
0
        public virtual IActionResult RedirectAfterNewUserCancelledPayment(AppUser user)
        {
            var url = ShopifyUrlHelper.GetAdminUrl(user.MyShopifyDomain);

            Logger.LogInformation($"Redirecting to {url}.");
            return(Redirect(url));
        }
        public void Get_admin_url_should_return_valid_admin_url()
        {
            var shop = "test.myshopify.com";
            var ret  = ShopifyUrlHelper.GetAdminUrl(shop);

            Assert.Equal($"https://{shop}/admin", ret);
        }
Beispiel #3
0
        public virtual async Task <ActionResult> LogOff()
        {
            Logger.LogInformation("Getting the current logged on user object first.");
            var me = await AppUserCache.GetLoggedOnUser();

            Logger.LogInformation("Current user is {@me}.", me);
            Logger.LogInformation("Now calling ClearLoggedOnUser() to clear the cache.");
            AppUserCache.ClearLoggedOnUser();
            Logger.LogInformation("Done calling ClearLoggedOnUser().");
            Logger.LogInformation("Now calling SignOutAsync() to do identity framework signout.");
            await _signInManager.SignOutAsync();

            Logger.LogInformation("Done calling SignOutAsync().");
            Logger.LogInformation("Now calling LogOffHappened() event.");
            await LogOffHappened(me);

            Logger.LogInformation("Done handling LogOffHappened() event.");
            var redirectTo = ShopifyUrlHelper.GetAdminUrl(me.MyShopifyDomain);

            Logger.LogInformation($"Now redirecting to '{redirectTo}'.");
            return(Redirect(ShopifyUrlHelper.GetAdminUrl(me.MyShopifyDomain)));
        }