fix: Enable period selector, add SSL support for wp_signon, add debug logging
This commit is contained in:
@@ -12,7 +12,7 @@ import type { SubItem } from '@/nav/tree';
|
|||||||
type Props = { items?: SubItem[]; fullscreen?: boolean };
|
type Props = { items?: SubItem[]; fullscreen?: boolean };
|
||||||
|
|
||||||
export default function DashboardSubmenuBar({ items = [], fullscreen = false }: Props) {
|
export default function DashboardSubmenuBar({ items = [], fullscreen = false }: Props) {
|
||||||
const { period, useDummy } = useDashboardPeriod();
|
const { period, setPeriod, useDummy } = useDashboardPeriod();
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ export default function DashboardSubmenuBar({ items = [], fullscreen = false }:
|
|||||||
|
|
||||||
{/* Period Selector, Refresh & Dummy Toggle */}
|
{/* Period Selector, Refresh & Dummy Toggle */}
|
||||||
<div className="flex items-center gap-2 flex-shrink-0">
|
<div className="flex items-center gap-2 flex-shrink-0">
|
||||||
<Select value={period} disabled>
|
<Select value={period} onValueChange={setPeriod}>
|
||||||
<SelectTrigger className="w-[140px] h-8">
|
<SelectTrigger className="w-[140px] h-8">
|
||||||
<SelectValue />
|
<SelectValue />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import { useDashboardContext } from '@/contexts/DashboardContext';
|
|||||||
* This replaces the local useState for period and useDummyData hook
|
* This replaces the local useState for period and useDummyData hook
|
||||||
*/
|
*/
|
||||||
export function useDashboardPeriod() {
|
export function useDashboardPeriod() {
|
||||||
const { period, useDummyData } = useDashboardContext();
|
const { period, setPeriod, useDummyData } = useDashboardContext();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
period,
|
period,
|
||||||
|
setPeriod,
|
||||||
useDummy: useDummyData,
|
useDummy: useDummyData,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,13 @@ class AuthController {
|
|||||||
'remember' => true,
|
'remember' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
$user = wp_signon( $credentials, false );
|
$user = wp_signon( $credentials, is_ssl() );
|
||||||
|
|
||||||
|
// Debug logging
|
||||||
|
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||||
|
error_log( '[AuthController::login] wp_signon result: ' . ( is_wp_error( $user ) ? 'ERROR' : 'SUCCESS' ) );
|
||||||
|
error_log( '[AuthController::login] User ID: ' . ( is_wp_error( $user ) ? 'N/A' : $user->ID ) );
|
||||||
|
}
|
||||||
|
|
||||||
if ( is_wp_error( $user ) ) {
|
if ( is_wp_error( $user ) ) {
|
||||||
return new WP_REST_Response( [
|
return new WP_REST_Response( [
|
||||||
|
|||||||
Reference in New Issue
Block a user