File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -91,3 +91,12 @@ export function checkAppUrl() {
9191 showGlobalErrorMessage ( `Your ROOT_URL in app.ini is "${ appUrl } ", it's unlikely matching the site you are visiting.
9292Mismatched ROOT_URL config causes wrong URL links for web UI/mail content/webhook notification/OAuth2 sign-in.` , 'warning' ) ;
9393}
94+
95+ export function checkAppUrlScheme ( ) {
96+ const curUrl = window . location . href ;
97+ // some users visit "http://domain" while appUrl is "https://domain", COOKIE_SECURE makes it impossible to sign in
98+ if ( curUrl . startsWith ( 'http:' ) && appUrl . startsWith ( 'https:' ) ) {
99+ showGlobalErrorMessage ( `Your ROOT_URL in app.ini "${ appUrl } " uses HTTPS, it doesn't match the HTTP site you are visiting.
100+ Mismatched ROOT_URL config would cause problems for sign-in/sign-up, etc.` , 'warning' ) ;
101+ }
102+ }
Original file line number Diff line number Diff line change 1- import { checkAppUrl } from './common-page.js ' ;
1+ import { checkAppUrl , checkAppUrlScheme } from './common-page.ts ' ;
22
33export function initUserCheckAppUrl ( ) {
44 if ( ! document . querySelector ( '.page-content.user.signin, .page-content.user.signup, .page-content.user.link-account' ) ) return ;
5- checkAppUrl ( ) ;
5+ checkAppUrlScheme ( ) ;
66}
77
88export function initUserAuthOauth2 ( ) {
99 const outer = document . querySelector ( '#oauth2-login-navigator' ) ;
1010 if ( ! outer ) return ;
1111 const inner = document . querySelector ( '#oauth2-login-navigator-inner' ) ;
1212
13+ checkAppUrl ( ) ;
14+
1315 for ( const link of outer . querySelectorAll ( '.oauth-login-link' ) ) {
1416 link . addEventListener ( 'click' , ( ) => {
1517 inner . classList . add ( 'tw-invisible' ) ;
You can’t perform that action at this time.
0 commit comments