Compare commits
15 commits
develop
...
feat/reord
Author | SHA1 | Date | |
---|---|---|---|
|
53797d8795 | ||
|
0910eb550f | ||
|
b68f2e9c92 | ||
|
3128529d84 | ||
|
d4bdfa1d53 | ||
|
94eb18ee8a | ||
|
b56fed2435 | ||
|
02c66e5c1d | ||
|
65b057d67c | ||
|
965a8ba3a9 | ||
|
1f42a0f661 | ||
|
457368180f | ||
|
5f41c1211c | ||
|
444ccfd920 | ||
|
f41b30b485 |
10 changed files with 33 additions and 16 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"
|
||||
|
@ -75,7 +75,7 @@
|
|||
/>
|
||||
|
||||
<chat-type-tabs
|
||||
v-if="!hasAppliedFiltersOrActiveFolders"
|
||||
v-if="!hasAppliedFiltersOrActiveFolders && !isIframe"
|
||||
:items="assigneeTabItems"
|
||||
:active-tab="activeAssigneeTab"
|
||||
class="tab--chat-type"
|
||||
|
@ -218,6 +218,9 @@ export default {
|
|||
appliedFilters: 'getAppliedConversationFilters',
|
||||
folders: 'customViews/getCustomViews',
|
||||
}),
|
||||
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"
|
||||
|
@ -57,6 +57,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);
|
||||
};
|
||||
|
|
|
@ -12,14 +12,14 @@ class Inboxes::FetchImapEmailsJob < ApplicationJob
|
|||
rescue Errno::ECONNREFUSED, Net::OpenTimeout, Net::IMAP::NoResponseError
|
||||
channel.authorization_error!
|
||||
rescue StandardError => e
|
||||
channel.authorization_error!
|
||||
# channel.authorization_error!
|
||||
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def should_fetch_email?(channel)
|
||||
channel.imap_enabled? && !channel.reauthorization_required?
|
||||
channel.imap_enabled?
|
||||
end
|
||||
|
||||
def process_mail_for_channel(channel)
|
||||
|
@ -36,12 +36,17 @@ class Inboxes::FetchImapEmailsJob < ApplicationJob
|
|||
new_mails = false
|
||||
|
||||
Mail.find(what: :last, count: 10, order: :desc).each do |inbound_mail|
|
||||
if inbound_mail.date.utc >= channel.imap_inbox_synced_at
|
||||
next unless inbound_mail.date.utc >= channel.imap_inbox_synced_at
|
||||
|
||||
begin
|
||||
Imap::ImapMailbox.new.process(inbound_mail, channel)
|
||||
new_mails = true
|
||||
rescue StandardError => e
|
||||
Sentry.capture_exception(e)
|
||||
end
|
||||
new_mails = true
|
||||
end
|
||||
|
||||
channel.update(imap_inbox_synced_at: Time.now.utc) if new_mails
|
||||
channel.reauthorized!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
module Reauthorizable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 2
|
||||
AUTHORIZATION_ERROR_THRESHOLD = 15
|
||||
|
||||
# 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