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));
        }
Exemple #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));
        }
Exemple #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));
     }
 }
        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);
        }
Exemple #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();
        }
Exemple #6
0
 public MainVM()
 {
     User          = new User();
     LoginCommand  = new LoginCommand(this);
     SignupCommand = new SignupCommand(this);
 }
Exemple #7
0
 private void OnIsLoadingChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Exemple #8
0
 private void OnPasswordChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Exemple #9
0
 private void OnEmailChanged()
 => SignupCommand.RaiseCanExecuteChanged();
Exemple #10
0
 public async Task <IActionResult> SignUp([FromBody] SignupCommand model)
 {
     return(Ok(await Mediator.Send(model)));
 }