Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration #3

Open
bahudso opened this issue Jul 1, 2014 · 8 comments
Open

Registration #3

bahudso opened this issue Jul 1, 2014 · 8 comments

Comments

@bahudso
Copy link

bahudso commented Jul 1, 2014

An enhancement would be to have registration rather than simply login.

@givanse
Copy link
Owner

givanse commented Jul 1, 2014

You can achieve that from an Ember route/template by sending a POST request to the route provided by Devise /users/sign_up. You just have to write your own form/template and have it send the values that Devise expects.

A feature like this is out of scope for this project. The objective here is to get you started with the authentication process only.

@bahudso
Copy link
Author

bahudso commented Jul 1, 2014

I am having issues with the CSRF token authenticity.

Started GET "/api/csrf" for 127.0.0.1 at 2014-07-01 17:44:31 -0400
Processing by Api::CsrfController#index as */*
Completed 200 OK in 1ms (Views: 0.1ms | ActiveRecord: 0.0ms)


Started POST "/users" for 127.0.0.1 at 2014-07-01 17:44:38 -0400
Processing by Devise::RegistrationsController#create as HTML
Can't verify CSRF token authenticity
Completed 422 Unprocessable Entity in 3ms

ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): 

https://github.com/bahudso/ember-rails-blog

@givanse
Copy link
Owner

givanse commented Jul 1, 2014

Check that rails-csrf is installed and working properly.

@bahudso
Copy link
Author

bahudso commented Jul 1, 2014

After reinstalling & updating to rails-csrf 0.0.4 it is working. But after restarting both the rails and ember servers it now fails again...

Now after reverting back to 0.0.3 it works fine. But the user is not added to the rails backend, and after registration any login succeeds...

I attempted to add it to a fork of this repo here: https://github.com/bahudso/ember-cli-simple-auth-devise

@givanse
Copy link
Owner

givanse commented Jul 2, 2014

If any input logins successfully its because the server is sending session cookies, disable them. There is a note about that in the README.

I'll probably need this too, not sure how soon, but I'll update this thread when its done.

@givanse
Copy link
Owner

givanse commented Jul 2, 2014

@givanse
Copy link
Owner

givanse commented Aug 3, 2014

For future reference: mainmatter/ember-simple-auth#73

@givanse givanse reopened this Aug 3, 2014
@Leooo
Copy link

Leooo commented Aug 19, 2015

Just adding a serverTokenRegisterEndpoint, and an option in simple-auth/session/authenticate, simple-auth-devise/authenticators/devise/authenticate, simple-auth-device/authenticators/devise/makeRequest to toggle the EndPoint between sign in ( serverTokenRegisterEndpoint) and sign up (serverTokenEndpoint) ?

=> Sign in up from an ajax request then using ember-simple-auth's authenticate method needs two server requests when it is not really needed: we can send the credentials straight from the signup request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants