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
|
||||
around_action :switch_locale
|
||||
before_action :ensure_installation_onboarding, only: [:index]
|
||||
after_action :allow_iframe_requests
|
||||
|
||||
layout 'vueapp'
|
||||
|
||||
|
@ -37,6 +38,10 @@ class DashboardController < ActionController::Base
|
|||
redirect_to '/installation/onboarding' if ::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
|
||||
end
|
||||
|
||||
def allow_iframe_requests
|
||||
response.headers.delete('X-Frame-Options')
|
||||
end
|
||||
|
||||
def app_config
|
||||
{
|
||||
APP_VERSION: Chatwoot.config[:version],
|
||||
|
|
|
@ -27,7 +27,7 @@ class DeviseOverrides::SessionsController < ::DeviseTokenAuth::SessionsControlle
|
|||
|
||||
sign_in(:user, @resource, store: false, bypass: false)
|
||||
# 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
|
||||
|
||||
def process_sso_auth_token
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{{ pageTitle }}
|
||||
</h1>
|
||||
|
||||
<div class="filter--actions">
|
||||
<div class="filter--actions" :class="{ 'margin-right-small': isIframe }">
|
||||
<chat-filter
|
||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||
@statusFilterChange="updateStatusType"
|
||||
|
@ -74,7 +74,7 @@
|
|||
/>
|
||||
|
||||
<chat-type-tabs
|
||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||
v-if="!hasAppliedFiltersOrActiveFolders && !isIframe"
|
||||
:items="assigneeTabItems"
|
||||
:active-tab="activeAssigneeTab"
|
||||
class="tab--chat-type"
|
||||
|
@ -234,6 +234,9 @@ export default {
|
|||
folders: 'customViews/getCustomViews',
|
||||
inboxes: 'inboxes/getInboxes',
|
||||
}),
|
||||
isIframe() {
|
||||
return window.self !== window.top;
|
||||
},
|
||||
hasAppliedFilters() {
|
||||
return this.appliedFilters.length !== 0;
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
>
|
||||
{{ this.$t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
||||
</woot-button>
|
||||
<woot-button
|
||||
<!-- <woot-button
|
||||
v-if="showAdditionalActions"
|
||||
ref="arrowDownButton"
|
||||
:color-scheme="buttonClass"
|
||||
|
@ -41,7 +41,7 @@
|
|||
icon="chevron-down"
|
||||
emoji="🔽"
|
||||
@click="openDropdown"
|
||||
/>
|
||||
/> -->
|
||||
</div>
|
||||
<div
|
||||
v-if="showActionsDropdown"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<aside class="woot-sidebar">
|
||||
<aside v-if="!isIframe" class="woot-sidebar">
|
||||
<primary-sidebar
|
||||
:logo-source="globalConfig.logoThumbnail"
|
||||
:installation-name="globalConfig.installationName"
|
||||
|
@ -65,6 +65,9 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
isIframe() {
|
||||
return window.self !== window.top;
|
||||
},
|
||||
...mapGetters({
|
||||
currentUser: 'getCurrentUser',
|
||||
globalConfig: 'globalConfig/get',
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div v-if="shouldShowContextMenu" class="context-menu-wrap">
|
||||
<context-menu
|
||||
<!-- <context-menu
|
||||
v-if="isBubble && !isMessageDeleted"
|
||||
:is-open="showContextMenu"
|
||||
:show-copy="hasText"
|
||||
|
@ -104,7 +104,7 @@
|
|||
@toggle="handleContextMenuClick"
|
||||
@delete="handleDelete"
|
||||
@copy="handleCopy"
|
||||
/>
|
||||
/> -->
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
|
@ -122,7 +122,7 @@ import BubbleVideo from './bubble/Video.vue';
|
|||
import BubbleActions from './bubble/Actions';
|
||||
|
||||
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 contentTypeMixin from 'shared/mixins/contentTypeMixin';
|
||||
|
@ -137,7 +137,7 @@ export default {
|
|||
BubbleFile,
|
||||
BubbleVideo,
|
||||
BubbleMailHead,
|
||||
ContextMenu,
|
||||
// ContextMenu,
|
||||
Spinner,
|
||||
},
|
||||
mixins: [alertMixin, timeMixin, messageFormatterMixin, contentTypeMixin],
|
||||
|
|
|
@ -27,6 +27,7 @@ export const setAuthCredentials = response => {
|
|||
const expiryDate = getHeaderExpiry(response);
|
||||
Cookies.set('cw_d_session_info', response.headers, {
|
||||
expires: differenceInDays(expiryDate, new Date()),
|
||||
sameSite: 'Lax',
|
||||
});
|
||||
setUser(response.data.data, expiryDate);
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ class Channel::Email < ApplicationRecord
|
|||
include Channelable
|
||||
include Reauthorizable
|
||||
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 10
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 150
|
||||
|
||||
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,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
module Reauthorizable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 2
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 150
|
||||
|
||||
# model attribute
|
||||
def reauthorization_required?
|
||||
|
|
|
@ -3,7 +3,7 @@ module SsoAuthenticatable
|
|||
|
||||
def generate_sso_auth_token
|
||||
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
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue