Compare commits

...

15 commits

Author SHA1 Message Date
Pranav Raj S
53797d8795 Merge branch 'develop' into feat/reorder-sidebar 2022-06-01 17:22:19 +05:30
Pranav Raj S
0910eb550f Catch IMAP Job processing 2022-05-31 20:22:50 +05:30
Pranav Raj S
b68f2e9c92 Disable check for reauthorization 2022-05-30 12:20:10 +05:30
Pranav Raj S
3128529d84 chore: Update reauthorizable 2022-05-25 21:37:11 +05:30
Pranav Raj S
d4bdfa1d53 Merge branch 'develop' into feat/reorder-sidebar 2022-05-05 20:01:17 +05:30
Pranav Raj S
94eb18ee8a Fix Filter 2022-01-12 14:25:59 -08:00
Pranav Raj S
b56fed2435 Revert Changes 2022-01-12 14:21:00 -08:00
Pranav Raj S
02c66e5c1d Merge branch 'master' into feat/reorder-sidebar 2022-01-12 13:57:58 -08:00
Pranav Raj S
65b057d67c Revert "Add secure: true"
This reverts commit 1f42a0f661.
2021-10-04 22:35:02 +05:30
Pranav Raj S
965a8ba3a9 Disable tabs 2021-10-04 22:34:04 +05:30
Pranav Raj S
1f42a0f661 Add secure: true 2021-10-04 20:51:28 +05:30
Pranav Raj S
457368180f Add sameSite to Lax 2021-10-04 20:43:11 +05:30
Pranav Raj S
5f41c1211c Allow iframe requests 2021-10-04 20:36:54 +05:30
Pranav Raj S
444ccfd920 Change to 5.years 2021-10-04 20:30:07 +05:30
Pranav Raj S
f41b30b485 Reorder, remove snooze, delete, sso_auth_token 2021-10-04 17:12:47 +05:30
10 changed files with 33 additions and 16 deletions

View file

@ -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],

View file

@ -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

View file

@ -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;
},

View file

@ -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"

View file

@ -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',

View file

@ -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],

View file

@ -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);
};

View file

@ -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

View file

@ -13,7 +13,7 @@
module Reauthorizable
extend ActiveSupport::Concern
AUTHORIZATION_ERROR_THRESHOLD = 2
AUTHORIZATION_ERROR_THRESHOLD = 15
# model attribute
def reauthorization_required?

View file

@ -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