some module updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -17,18 +17,20 @@
|
||||
$payload = await response.json();
|
||||
};
|
||||
</script>
|
||||
|
||||
<h1>Welcome to 3D-Belte</h1>
|
||||
<p>Visit <a href="/about">about page</a> to read the documentation. First press send, than read.</p>
|
||||
<div class="body">
|
||||
<div class="form">
|
||||
<span>JWT Token</span>
|
||||
<textarea>{$token}</textarea>
|
||||
<span>Payload</span>
|
||||
<textarea>{JSON.stringify($payload)}</textarea>
|
||||
<button onclick={onSendClick}>send</button>
|
||||
<button onclick={onReadClick}>read</button>
|
||||
</div>
|
||||
<div class="form">
|
||||
<span>JWT Token</span>
|
||||
<textarea>{$token}</textarea>
|
||||
<span>Payload</span>
|
||||
<textarea>{JSON.stringify($payload)}</textarea>
|
||||
<button onclick={onSendClick}>send</button>
|
||||
<button onclick={onReadClick}>read</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.body {
|
||||
margin: 0;
|
||||
@@ -47,4 +49,3 @@
|
||||
border: 1px solid gray;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
<p> Dies ist eine Dokumentation </p>
|
||||
<p>Dies ist eine Dokumentation</p>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import { json } from "@sveltejs/kit";
|
||||
import jwt from "jsonwebtoken";
|
||||
import { json } from '@sveltejs/kit';
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
export async function POST() {
|
||||
const token = await jwt.sign({
|
||||
id: 'sample-id',
|
||||
secret: 'secret'
|
||||
},"shhhhh");
|
||||
const token = await jwt.sign(
|
||||
{
|
||||
id: 'sample-id',
|
||||
secret: 'secret'
|
||||
},
|
||||
'shhhhh'
|
||||
);
|
||||
return json({ token });
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { error } from "@sveltejs/kit";
|
||||
import { json } from "@sveltejs/kit";
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { json } from '@sveltejs/kit';
|
||||
//
|
||||
// import { verify } from 'jsonwebtoken';
|
||||
import jwt from 'jsonwebtoken'; const { sign, verify } = jwt;
|
||||
import jwt from 'jsonwebtoken';
|
||||
const { sign, verify } = jwt;
|
||||
|
||||
export function GET({ request }) {
|
||||
const authorization = request.headers.get('authorization');
|
||||
|
||||
Reference in New Issue
Block a user