Skip to content
Snippets Groups Projects
Commit 6f55db42 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Alert admin if configured url is different from current

parent 22739812
No related branches found
No related tags found
No related merge requests found
......@@ -30,3 +30,18 @@ RocketChat.settings.init = ->
initialLoad = false
RocketChat.settings.init()
Meteor.startup ->
Tracker.autorun (c) ->
siteUrl = RocketChat.settings.get('Site_Url')
if not siteUrl or not Meteor.userId()?
return
if RocketChat.authz.hasRole(Meteor.userId(), 'admin') is false
return c.stop()
siteUrl = siteUrl.replace /\/$/, ''
if siteUrl isnt location.origin
toastr.warning TAPi18n.__('The_configured_URL_is_different_from_the_URL_you_are_accessing'), TAPi18n.__('Warning')
return c.stop()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment