Sorio
Explore posts from serverserror with the supabase module in server side
import { serverSupabaseUser, serverSupabaseClient } from '#supabase/server'
import { Database } from '../types/database'
export default defineEventHandler(async (event) => {
const user : any = await serverSupabaseUser(event)
if (!user) {
throw createError({ statusCode: 401, statusMessage: 'Unauthorized' })
}
const client = await serverSupabaseClient<Database>(event)
const body = await readBody(event)
console.log(body)
const id = body.id
const completed = body.done
if (typeof completed !== 'boolean') {
throw createError({ statusCode: 400, statusMessage: 'Invalid request' })
}
console.log(typeof completed)
const { data } = await client.from('tasks').update({done : completed}).eq('id', id).select()
return data
})
25 replies
Nuxt X Supabase Oauth with Github
I don't understand because my url callback is http://localhost:3000/confirm. Should my callback url be this?
7 replies
Nuxt X Supabase Oauth with Github
oops I should read more carefully.
Now when I click on my button I am redirected to my "confirm" page with this url http://localhost:3000/confirm?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https://docs.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/%23redirect-uri-mismatch&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjA2ODkwMjUsInNpdGVfdXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwL2NvbmZpcm0iLCJpZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIsImZ1bmN0aW9uX2hvb2tzIjpudWxsLCJwcm92aWRlciI6ImdpdGh1YiIsInJlZmVycmVyIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwL2NvbmZpcm0iLCJmbG93X3N0YXRlX2lkIjoiZjdhZjMxM2UtNjdjMi00OTZlLWEwMTMtNWZmNDU5ZjdiZmI1In0.V-SP1cIpkOSFXz21BT3Jilu2W-z7KbPPjys67T5KuM0
7 replies