Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/credentialImportForm/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { useSession, signIn } from 'next-auth/react'
import { useRouter } from 'next/navigation'
import VisibilityIcon from '@mui/icons-material/Visibility'
import { saveRaw } from '../utils/googleDrive'

const formLabelStyles = {
fontFamily: 'Lato',
Expand Down Expand Up @@ -239,6 +240,17 @@ function SimpleCredentialForm() {
data: vcData
})

// Save the credential directly to Google Drive
if (accessToken) {
try {
const savedFile = await saveRaw(accessToken, vcData)
console.log('Credential saved to Google Drive:', savedFile)
} catch (saveError) {
console.error('Error saving to Google Drive:', saveError)
// Continue with form flow even if save fails
}
}

// Navigate to the credentialForm route after a short delay to show success message
setTimeout(() => {
router.push('/credentialForm')
Expand Down