# Loading our SiteSetting properties before plugin loads

**URL:** <https://meta.discourse.org/t/loading-our-sitesetting-properties-before-plugin-loads/45572>\
**Category:** Development\
**Created:** [11 Giugno 2016, 7:09pm UTC](https://meta.discourse.org/t/loading-our-sitesetting-properties-before-plugin-loads/45572 "2016-06-11T19:09:02Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [4 Luglio 2016, 1:14pm UTC](https://meta.discourse.org/t/loading-our-sitesetting-properties-before-plugin-loads/45572/7 "2016-07-04T13:14:33Z")

</div>

Okay, so it seems this may not be the best place to use SiteSetting and might be best to stick to ENV, as now it is capable of reading the SiteSetting, but because it is registered when Discourse starts, it doesn’t and potentially can’t, pick up on changes to the SiteSettings it refers to without stopping and starting Discourse again.

My Steps that seem to indicate this

- Installed an oauth plugin using SiteSetting inside register\_middleware
- Update SiteSettings
- Attempt login using ‘with Authenicator’
- Get OAuth Bad Parameters error
- Stop/Start Discourse
- Attempt login
- Success!

So unless there is a way to de-register and re-register the middleware, I’m not sure storing this data in SiteSetting is going to help anything. @def, are you seeing similar results?

---

_[View the full topic](https://meta.discourse.org/t/loading-our-sitesetting-properties-before-plugin-loads/45572)._
