article update automation #4
@@ -0,0 +1,16 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
|
||||
import {
|
||||
TOKEN
|
||||
} from '$env/static/private'
|
||||
|
||||
export const POST: RequestHandler = ({ url }) => {
|
||||
const token = url.searchParams.get('token');
|
||||
console.log(token);
|
||||
if (token !== TOKEN) {
|
||||
return error(401, 'Unauthorized');
|
||||
}
|
||||
return new Response(String(token));
|
||||
};
|
||||
Reference in New Issue
Block a user