Designänderungen und Tokengenerierungsfunktion

This commit is contained in:
ja
2021-10-06 16:19:21 +02:00
parent d1a4cd5120
commit 94cc216ecb
2 changed files with 19 additions and 3 deletions

View File

@@ -72,14 +72,14 @@
<form id="form1" runat="server">
<center>
<table id="tbl_main" cellpadding="0">
<tr style="background-color:#fff; color:#003680;height:30px;">
<tr style="color:#003680;height:35px;">
<td>
<asp:Button ID="btn_Back" runat="server" Text="Back" PostBackUrl="~/login/login_FLEX.aspx" OnClick="btn_Back_Click"/>
</td>
</tr>
<tr style="color:#003680; height:30px;font-size:12px">
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">
<asp:Label ID="lbl_PWvergessen" Text="Haben Sie ihr Passwort vergessen?" runat="server" style=" background-color:#fff; color:#003680; font-size:12px"></asp:Label>
<asp:Label ID="lbl_PWvergessen" Text="Haben Sie ihr Passwort vergessen?" runat="server" style="color:#003680; font-size:15px"></asp:Label>
</td></tr>
<!-- <tr style=" background-color:#fff; color:#003680; height:30px;font-size:12px">
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">

View File

@@ -106,7 +106,23 @@ Partial Class login_ForgotPW
Return False
End Function
Function genToken() As String
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
Dim token As String = Convert.ToBase64String(time.Concat(Key).ToArray())
Return token
End Function
Function getDateoftoken(tokenname As String) As Boolean
Dim data() As Byte = Convert.FromBase64String(tokenname)
Dim wenn As DateTime = DateTime.FromBinary(BitConverter.ToInt64(data, 0))
If wenn < DateTime.UtcNow.AddHours(-24) Then
Return False
MsgBox("Token nicht gefunden oder zu alt!" + Environment.NewLine + "Bitte erneut Mail senden!")
Else
Return True
End If
End Function
Protected Sub txtEmail_TextChanged(sender As Object, e As EventArgs)
regexval_txt_Email.Validate()