0
使用Microsoft.AspNet.Identity我幾乎需要管理用戶問題,但我(一個vb.net初學者)無法更新此代碼以自動登錄用戶確認電子郵件地址時。當他確認電子郵件地址時登錄用戶
我想我需要一個方法只是基於UsedId
這是我試圖改變代碼即可獲得ApplicationUser:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim code As String = IdentityHelper.GetCodeFromRequest(Request)
Dim userId As String = IdentityHelper.GetUserIdFromRequest(Request)
If code IsNot Nothing AndAlso userId IsNot Nothing Then
Dim manager = Context.GetOwinContext().GetUserManager(Of ApplicationUserManager)()
Dim result = manager.ConfirmEmail(userId, code)
If result.Succeeded Then
'>>>>>>>>login the user
successPanel.Visible = True
Return
End If
End If
successPanel.Visible = False
errorPanel.Visible = True
End Sub
這個問題如此棘手或我的邏輯錯誤,因爲沒有人提出一個想法..? – tonics