예제 #1
0
        public async Task <IActionResult> ActivateAccount(string code = null)
        {
            // Build breadcrumb
            _breadCrumbManager.Configure(builder =>
            {
                builder.Add(S["Home"], home => home
                            .Action("Index", "Home", "Plato.Core")
                            .LocalNav()
                            ).Add(S["Activate Account"]);
            });

            var isValidConfirmationToken = false;

            if (!String.IsNullOrEmpty(code))
            {
                if (code.IsBase64String())
                {
                    var user = await _platoUserStore.GetByConfirmationToken(
                        Encoding.UTF8.GetString(Convert.FromBase64String(code)));

                    if (user != null)
                    {
                        isValidConfirmationToken = true;
                    }
                }
            }

            return(View(new ActivateAccountViewModel
            {
                IsValidConfirmationToken = isValidConfirmationToken,
                ConfirmationToken = code
            }));
        }