# Would anyone like to tell me how very wrong I am?

**URL:** https://meta.discourse.org/t/would-anyone-like-to-tell-me-how-very-wrong-i-am/60604
**Category:** SSO
**Created:** [7 באפריל,‏ 2017,‏ 2:57pm UTC](https://meta.discourse.org/t/would-anyone-like-to-tell-me-how-very-wrong-i-am/60604 "2017-04-07T14:57:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![npflood](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/npflood/32/120444_2.png) [@npflood](https://meta.discourse.org/u/npflood)
#### Post date: [7 באפריל,‏ 2017,‏ 2:57pm UTC](https://meta.discourse.org/t/would-anyone-like-to-tell-me-how-very-wrong-i-am/60604/1 "2017-04-07T14:57:21Z")

</div>

I’m implementing a strategy to synchronize sessions between Discourse and another rails application.

What I’m doing works. BUT I’m sure I’m violating several best-practices and missing some key optimizations. Anybody want to look at what I did and tell me where I’m going wrong?

[https://github.com/ECHOInternational/discourse-echo-login/](https://github.com/ECHOInternational/discourse-echo-login/)

I’m creating a new CurrentUserProvider that is heavily influenced by the default one that ships with Discourse. This provider checks for a shared domain cookie, and looks that cookie up in Redis. If a logged in user’s data is returned from Redis then that user is either registered or signed in using the SSO methods.

Any feedback is appreciated!

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [11 באפריל,‏ 2017,‏ 5:22pm UTC](https://meta.discourse.org/t/would-anyone-like-to-tell-me-how-very-wrong-i-am/60604/2 "2017-04-11T17:22:04Z")

</div>

Other devs will have an easier time reviewing your code if you can point directly to the parts of the code that worry you the most, one at a time.
