Ejemplo n.º 1
0
        public async Task <IActionResult> Signup([FromBody] SignupRequest request)
        {
            var cmd    = new SignupCommand(new ProjectData("", ""), request.EmailAddress, request.Password, request.Username);
            var result = await mediator.Send(cmd);

            return(result.Match <IActionResult>(user => Ok(), BadRequest));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Post([FromBody] SignUpToCourseDto signUpToCourseDto)
        {
            var command = new SignupCommand {
                SignUpToCourseDto = signUpToCourseDto
            };
            var response = await _mediator.Send(command);

            return(Ok(response));
        }
Ejemplo n.º 3
0
 public async Task <ActionResult <JwtToken> > Signup([FromBody] SignupCommand command)
 {
     try
     {
         return(Ok(await Mediator.Send(command)));
     }
     catch (UnauthorizedAccessException e)
     {
         return(Unauthorized(e.Message));
     }
 }
Ejemplo n.º 4
0
        public SignupViewModel(IParentService parentService, IUserDialogs userDialogs,
                               IMvxMessenger mvxMessenger, AppHelper appHelper) : base(userDialogs, mvxMessenger, appHelper)
        {
            _parentService = parentService;

            SignupCommand = ReactiveCommand
                            .CreateFromObservable <Unit, ParentEntity>(
                (_) => _parentService.Register(FirstName, LastName, Birthdate, Email, PasswordClear, ConfirmPassword, String.Concat(Prefix, Telephone)));

            SignupCommand.Subscribe(AccountCreated);

            SignupCommand.IsExecuting.Subscribe((isLoading) => HandleIsExecuting(isLoading, AppResources.Signup_CreatingAccount));

            SignupCommand.ThrownExceptions.Subscribe(HandleExceptions);
        }
Ejemplo n.º 5
0
        private async Task pickCountry()
        {
            getCountrySubscription?.Dispose();
            getCountrySubscription = null;

            var selectedCountryId = await navigationService
                                    .Navigate <SelectCountryViewModel, long?, long?>(countryId);

            if (selectedCountryId == null)
            {
                setCountryErrorIfNeeded();
                return;
            }

            var selectedCountry = allCountries
                                  .Single(country => country.Id == selectedCountryId.Value);

            IsCountryErrorVisible = false;
            countryId             = selectedCountry.Id;
            CountryButtonTitle    = selectedCountry.Name;
            SignupCommand.RaiseCanExecuteChanged();
        }
Ejemplo n.º 6
0
 public MainVM()
 {
     User          = new User();
     LoginCommand  = new LoginCommand(this);
     SignupCommand = new SignupCommand(this);
 }
Ejemplo n.º 7
0
 private void OnIsLoadingChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Ejemplo n.º 8
0
 private void OnPasswordChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Ejemplo n.º 9
0
 private void OnEmailChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Ejemplo n.º 10
0
 public async Task <IActionResult> SignUp([FromBody] SignupCommand model)
 {
     return(Ok(await Mediator.Send(model)));
 }