public int Step1(string username, byte[] renewToken) { if (CheckVendor.NotValidRenewToken(renewToken)) { return(03_0009); } var authRenew = new AuthRenew(); authRenew.Username = username; authRenew.RenewToken = renewToken; authRenew.ReportTime = DateTime.Now; var result = ApiCall.SessionRenew.Call(null, new MilvanethProtocol { Context = null, Data = authRenew }); if (!(result.Data is AuthResponse ar)) { return(02_0007); } if (!CheckVendor.NotValidResponse(ar)) { _authResponse = ar; } return(ar.Message); }
public static bool Check(this AuthRenew data) { return(data.RenewToken != null && data.RenewToken.Length == GlobalConfig.TOKEN_LENGTH && IsValidReportTime(data.ReportTime) && IsValidUsername(data.Username)); }
public async Task InsertAsync(AuthRenew authRenew, CancellationToken cancellationToken = default) { await _dbContext.RenewTokens.InsertOneAsync( _mapper.Map <AuthRenewEntity>(authRenew), null, cancellationToken ); }
public async Task AddAsync(AuthRenew authRenew, CancellationToken cancellationToken = default) { await _authRenewRepository.InsertAsync(authRenew, cancellationToken); }