This commit is contained in:
2025-06-17 14:15:34 +09:00
parent be8fd38c59
commit 292bf39c4e

View File

@@ -221,19 +221,25 @@ function App() {
const oauthResult = await atprotoOAuthService.checkSession(); const oauthResult = await atprotoOAuthService.checkSession();
if (oauthResult) { if (oauthResult) {
console.log('OAuth result found:', oauthResult);
// Ensure handle is not DID // Ensure handle is not DID
const handle = oauthResult.handle !== oauthResult.did ? oauthResult.handle : oauthResult.handle; const handle = oauthResult.handle !== oauthResult.did ? oauthResult.handle : oauthResult.handle;
console.log('Processed handle:', handle);
// Check if handle is allowed // Check if handle is allowed
if (appConfig.allowedHandles.length > 0 && !appConfig.allowedHandles.includes(handle)) { if (appConfig.allowedHandles.length > 0 && !appConfig.allowedHandles.includes(handle)) {
console.log('Handle not allowed:', handle, 'Allowed:', appConfig.allowedHandles);
// Handle not in allowed list // Handle not in allowed list
setError(`Access denied: ${handle} is not authorized for this application.`); setError(`Access denied: ${handle} is not authorized for this application.`);
setIsLoading(false); setIsLoading(false);
return; return;
} }
console.log('Getting user profile for:', oauthResult.did, handle);
// Get user profile including avatar // Get user profile including avatar
const userProfile = await getUserProfile(oauthResult.did, handle); const userProfile = await getUserProfile(oauthResult.did, handle);
console.log('User profile received:', userProfile);
setUser(userProfile); setUser(userProfile);
// Load all comments for display (this will be the default view) // Load all comments for display (this will be the default view)