public bool MatchRegistered(object[] MatchArgs, AckMessage.StatusType status, object data, AckMessage OrigAck) { bool Sent = false; foreach (RegisteredMessage RegMsg in RegisteredMessages) { if (RegMsg.Matches(MatchArgs)) { // we send an EventMessage based on this match using the args provided. AckMessage ack; ack = new AckMessage(status, data, (CommandMessage)RegMsg); ack.MatchParams = MatchArgs; if (null != OrigAck) { if (RegMsg.sender == OrigAck.sender)// really next a Next type jump. { goto End; } ack.sender = OrigAck.sender; // override source. } Sent |= Send(ack); End: // stupid labels must come before code. int x = 1; x += 1; } } return(Sent); }
public async Task <IActionResult> Registration(RegMsg reg) { var res = await um.CreateAsync(new IdentityUser { UserName = reg.Uname }, reg.Pass); if (res.Succeeded) { await um.AddToRoleAsync(await um.FindByNameAsync(reg.Uname), "Admin"); log.LogInformation("Succesfully registered"); return(Ok()); } log.LogError("There was mistake trying to register user"); return(BadRequest("Not registered")); }
public async Task <IActionResult> Login(RegMsg reg) { log.LogInformation("log in"); var kor = await um.FindByNameAsync(reg.Uname); if (kor is null) { log.LogError("User doesnt exist"); return(BadRequest("User null")); } var res = await sim.PasswordSignInAsync(kor, reg.Pass, false, false); if (res.Succeeded) { return(Ok()); } else { return(BadRequest("Error")); } }
public async Task Login(RegMsg l) { await api.Login(l); NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); }
public async Task Registration(RegMsg r) { await api.Registration(r); NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); }
public async Task Registration(RegMsg r) { await http.PostAsJsonAsync("api/userinfo/registration", r); }
public async Task Login(RegMsg l) { var res = await http.PostAsJsonAsync("api/userinfo/login", l); res.EnsureSuccessStatusCode(); }