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

Decouple from refinerycms-authentication-devise #446

Closed
bricesanchez opened this issue Jul 29, 2015 · 18 comments
Closed

Decouple from refinerycms-authentication-devise #446

bricesanchez opened this issue Jul 29, 2015 · 18 comments

Comments

@bricesanchez
Copy link
Member

At this time we have to use Blog at least with refinerycms authentication devise gem : https://github.com/refinery/refinerycms-blog/blob/master/lib/refinery/blog/configuration.rb#L28-L35

We can't use it without an authentication system (like for development or testing).

Perhaps we should be able to disable by default the author feature?

@bricesanchez bricesanchez changed the title Decouple from refinerycms-authentication Decouple from refinerycms-authentication-devise Jul 29, 2015
@parndt
Copy link
Member

parndt commented Jul 30, 2015

@bricesanchez can't we access authorisation_manager.current_user or whatever that API was?

@parndt
Copy link
Member

parndt commented Jul 30, 2015

@bricesanchez I think we should remove the author feature and implement it as purely a string field

@bricesanchez
Copy link
Member Author

I'm ok, we should rethink the author feature. I don't think it should be only a string, i use this feature with refinerycms-teams (Refinery::Team model) instead of Refinery::User. It's very useful.

@parndt
Copy link
Member

parndt commented Jul 30, 2015 via email

bricesanchez added a commit to bricesanchez/spree-refinerycms-test that referenced this issue Aug 7, 2015
@bricesanchez
Copy link
Member Author

@parndt i think yes.

parndt added a commit that referenced this issue Aug 10, 2015
This will need to be better addressed in #446 but.. it stops the errors.
@parndt
Copy link
Member

parndt commented Aug 10, 2015

I had to make a fix so that it would boot in current applications.
The problem is: it makes the build fail because we don't depend on refinerycms-authentication-devise and nor should we

parndt added a commit that referenced this issue Aug 10, 2015
@bricesanchez
Copy link
Member Author

Could we depend on refinerycms-authentication-devise only to run tests ?
And find another solution in the next stable version ?

@parndt
Copy link
Member

parndt commented Aug 10, 2015

@bricesanchez I don't think so.. but I have a branch where I attempt to solve this entirely: https://github.com/refinery/refinerycms-blog/compare/refinery-user-coupling

@parndt
Copy link
Member

parndt commented Aug 10, 2015

See #449

@marcelotto
Copy link

What's the status on this issue? On trying to integrate Refinery with Refinery-Blog in a Spree-app using Spree's authentication system via spree-refinery-authentication instead of refinerycms-authentication-devise I was running in issue #452. Are there any preliminary workarounds I could try to get this setup running?

@bricesanchez
Copy link
Member Author

bricesanchez commented Jun 1, 2016

@marcelotto At this time i manually create the blog initializer before running the extension generator : bricesanchez/spree-refinerycms-test@1e13ebd

@marcelotto
Copy link

@bricesanchez Thanks, that helped. 👍

@bricesanchez
Copy link
Member Author

bricesanchez commented Jun 1, 2016

@parndt Should we change this line :
https://github.com/refinery/refinerycms-blog/blob/master/lib/refinery/blog/configuration.rb#L29

 - class_name = @@user_class_name || "Refinery::Authentication::Devise::User"
 + class_name = @@user_class_name || "Refinery::Core::NilUser"

@bricesanchez
Copy link
Member Author

bricesanchez commented Jun 1, 2016

@marcelotto nice to know that there are spree-refinery-authentication users :)

@marcelotto
Copy link

A bit too early happy. When trying to create a post, it failed on the collection_select in /app/views/refinery/blog/admin/posts/_form.html.erb, since Spree::User has no username. Could workaround this by extending Spree::User with an appropriate alias:

Spree::User.class_eval do
  alias_attribute :username, :login
end

In a refinerycms-authentication-devise-decoupled solution it would be instrumental to have a config option to set the username attribute.

@bricesanchez spree-refinery-authentication works like a charm, thanks.

@bricesanchez
Copy link
Member Author

Extending Spree::User is the good way.

refinerycms-blog could be have a config to set the username attribute.

Feel free to open a pull request :)

@parndt
Copy link
Member

parndt commented Jun 1, 2016

@parndt Should we change this line :
https://github.com/refinery/refinerycms-blog/blob/master/lib/refinery/blog/configuration.rb#L29

  • class_name = @@user_class_name || "Refinery::Authentication::Devise::User"
  • class_name = @@user_class_name || "Refinery::Core::NilUser"

@bricesanchez Probably? Does it work?

@bricesanchez
Copy link
Member Author

Closed in favor of #459

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