Compare commits
20 commits
develop
...
self-hoste
Author | SHA1 | Date | |
---|---|---|---|
|
74c4017d12 | ||
|
2954d938e7 | ||
|
681dbeaf46 | ||
|
0c0f410727 | ||
|
b9a5b15de1 | ||
|
53797d8795 | ||
|
0910eb550f | ||
|
b68f2e9c92 | ||
|
3128529d84 | ||
|
d4bdfa1d53 | ||
|
94eb18ee8a | ||
|
b56fed2435 | ||
|
02c66e5c1d | ||
|
65b057d67c | ||
|
965a8ba3a9 | ||
|
1f42a0f661 | ||
|
457368180f | ||
|
5f41c1211c | ||
|
444ccfd920 | ||
|
f41b30b485 |
10 changed files with 25 additions and 13 deletions
|
@ -4,6 +4,7 @@ class DashboardController < ActionController::Base
|
||||||
before_action :set_global_config
|
before_action :set_global_config
|
||||||
around_action :switch_locale
|
around_action :switch_locale
|
||||||
before_action :ensure_installation_onboarding, only: [:index]
|
before_action :ensure_installation_onboarding, only: [:index]
|
||||||
|
after_action :allow_iframe_requests
|
||||||
|
|
||||||
layout 'vueapp'
|
layout 'vueapp'
|
||||||
|
|
||||||
|
@ -37,6 +38,10 @@ class DashboardController < ActionController::Base
|
||||||
redirect_to '/installation/onboarding' if ::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
|
redirect_to '/installation/onboarding' if ::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def allow_iframe_requests
|
||||||
|
response.headers.delete('X-Frame-Options')
|
||||||
|
end
|
||||||
|
|
||||||
def app_config
|
def app_config
|
||||||
{
|
{
|
||||||
APP_VERSION: Chatwoot.config[:version],
|
APP_VERSION: Chatwoot.config[:version],
|
||||||
|
|
|
@ -27,7 +27,7 @@ class DeviseOverrides::SessionsController < ::DeviseTokenAuth::SessionsControlle
|
||||||
|
|
||||||
sign_in(:user, @resource, store: false, bypass: false)
|
sign_in(:user, @resource, store: false, bypass: false)
|
||||||
# invalidate the token after the user is signed in
|
# invalidate the token after the user is signed in
|
||||||
@resource.invalidate_sso_auth_token(params[:sso_auth_token])
|
# @resource.invalidate_sso_auth_token(params[:sso_auth_token])
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_sso_auth_token
|
def process_sso_auth_token
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{{ pageTitle }}
|
{{ pageTitle }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="filter--actions">
|
<div class="filter--actions" :class="{ 'margin-right-small': isIframe }">
|
||||||
<chat-filter
|
<chat-filter
|
||||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||||
@statusFilterChange="updateStatusType"
|
@statusFilterChange="updateStatusType"
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<chat-type-tabs
|
<chat-type-tabs
|
||||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
v-if="!hasAppliedFiltersOrActiveFolders && !isIframe"
|
||||||
:items="assigneeTabItems"
|
:items="assigneeTabItems"
|
||||||
:active-tab="activeAssigneeTab"
|
:active-tab="activeAssigneeTab"
|
||||||
class="tab--chat-type"
|
class="tab--chat-type"
|
||||||
|
@ -234,6 +234,9 @@ export default {
|
||||||
folders: 'customViews/getCustomViews',
|
folders: 'customViews/getCustomViews',
|
||||||
inboxes: 'inboxes/getInboxes',
|
inboxes: 'inboxes/getInboxes',
|
||||||
}),
|
}),
|
||||||
|
isIframe() {
|
||||||
|
return window.self !== window.top;
|
||||||
|
},
|
||||||
hasAppliedFilters() {
|
hasAppliedFilters() {
|
||||||
return this.appliedFilters.length !== 0;
|
return this.appliedFilters.length !== 0;
|
||||||
},
|
},
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
>
|
>
|
||||||
{{ this.$t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
{{ this.$t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
||||||
</woot-button>
|
</woot-button>
|
||||||
<woot-button
|
<!-- <woot-button
|
||||||
v-if="showAdditionalActions"
|
v-if="showAdditionalActions"
|
||||||
ref="arrowDownButton"
|
ref="arrowDownButton"
|
||||||
:color-scheme="buttonClass"
|
:color-scheme="buttonClass"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
icon="chevron-down"
|
icon="chevron-down"
|
||||||
emoji="🔽"
|
emoji="🔽"
|
||||||
@click="openDropdown"
|
@click="openDropdown"
|
||||||
/>
|
/> -->
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="showActionsDropdown"
|
v-if="showActionsDropdown"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<aside class="woot-sidebar">
|
<aside v-if="!isIframe" class="woot-sidebar">
|
||||||
<primary-sidebar
|
<primary-sidebar
|
||||||
:logo-source="globalConfig.logoThumbnail"
|
:logo-source="globalConfig.logoThumbnail"
|
||||||
:installation-name="globalConfig.installationName"
|
:installation-name="globalConfig.installationName"
|
||||||
|
@ -65,6 +65,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
isIframe() {
|
||||||
|
return window.self !== window.top;
|
||||||
|
},
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentUser: 'getCurrentUser',
|
currentUser: 'getCurrentUser',
|
||||||
globalConfig: 'globalConfig/get',
|
globalConfig: 'globalConfig/get',
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="shouldShowContextMenu" class="context-menu-wrap">
|
<div v-if="shouldShowContextMenu" class="context-menu-wrap">
|
||||||
<context-menu
|
<!-- <context-menu
|
||||||
v-if="isBubble && !isMessageDeleted"
|
v-if="isBubble && !isMessageDeleted"
|
||||||
:is-open="showContextMenu"
|
:is-open="showContextMenu"
|
||||||
:show-copy="hasText"
|
:show-copy="hasText"
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
@toggle="handleContextMenuClick"
|
@toggle="handleContextMenuClick"
|
||||||
@delete="handleDelete"
|
@delete="handleDelete"
|
||||||
@copy="handleCopy"
|
@copy="handleCopy"
|
||||||
/>
|
/> -->
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
@ -122,7 +122,7 @@ import BubbleVideo from './bubble/Video.vue';
|
||||||
import BubbleActions from './bubble/Actions';
|
import BubbleActions from './bubble/Actions';
|
||||||
|
|
||||||
import Spinner from 'shared/components/Spinner';
|
import Spinner from 'shared/components/Spinner';
|
||||||
import ContextMenu from 'dashboard/modules/conversations/components/MessageContextMenu';
|
// import ContextMenu from 'dashboard/modules/conversations/components/MessageContextMenu';
|
||||||
|
|
||||||
import alertMixin from 'shared/mixins/alertMixin';
|
import alertMixin from 'shared/mixins/alertMixin';
|
||||||
import contentTypeMixin from 'shared/mixins/contentTypeMixin';
|
import contentTypeMixin from 'shared/mixins/contentTypeMixin';
|
||||||
|
@ -137,7 +137,7 @@ export default {
|
||||||
BubbleFile,
|
BubbleFile,
|
||||||
BubbleVideo,
|
BubbleVideo,
|
||||||
BubbleMailHead,
|
BubbleMailHead,
|
||||||
ContextMenu,
|
// ContextMenu,
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
mixins: [alertMixin, timeMixin, messageFormatterMixin, contentTypeMixin],
|
mixins: [alertMixin, timeMixin, messageFormatterMixin, contentTypeMixin],
|
||||||
|
|
|
@ -27,6 +27,7 @@ export const setAuthCredentials = response => {
|
||||||
const expiryDate = getHeaderExpiry(response);
|
const expiryDate = getHeaderExpiry(response);
|
||||||
Cookies.set('cw_d_session_info', response.headers, {
|
Cookies.set('cw_d_session_info', response.headers, {
|
||||||
expires: differenceInDays(expiryDate, new Date()),
|
expires: differenceInDays(expiryDate, new Date()),
|
||||||
|
sameSite: 'Lax',
|
||||||
});
|
});
|
||||||
setUser(response.data.data, expiryDate);
|
setUser(response.data.data, expiryDate);
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Channel::Email < ApplicationRecord
|
||||||
include Channelable
|
include Channelable
|
||||||
include Reauthorizable
|
include Reauthorizable
|
||||||
|
|
||||||
AUTHORIZATION_ERROR_THRESHOLD = 10
|
AUTHORIZATION_ERROR_THRESHOLD = 150
|
||||||
|
|
||||||
self.table_name = 'channel_email'
|
self.table_name = 'channel_email'
|
||||||
EDITABLE_ATTRS = [:email, :imap_enabled, :imap_login, :imap_password, :imap_address, :imap_port, :imap_enable_ssl, :imap_inbox_synced_at,
|
EDITABLE_ATTRS = [:email, :imap_enabled, :imap_login, :imap_password, :imap_address, :imap_port, :imap_enable_ssl, :imap_inbox_synced_at,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
module Reauthorizable
|
module Reauthorizable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
AUTHORIZATION_ERROR_THRESHOLD = 2
|
AUTHORIZATION_ERROR_THRESHOLD = 150
|
||||||
|
|
||||||
# model attribute
|
# model attribute
|
||||||
def reauthorization_required?
|
def reauthorization_required?
|
||||||
|
|
|
@ -3,7 +3,7 @@ module SsoAuthenticatable
|
||||||
|
|
||||||
def generate_sso_auth_token
|
def generate_sso_auth_token
|
||||||
token = SecureRandom.hex(32)
|
token = SecureRandom.hex(32)
|
||||||
::Redis::Alfred.setex(sso_token_key(token), true, 5.minutes)
|
::Redis::Alfred.setex(sso_token_key(token), true, 5.years)
|
||||||
token
|
token
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue