mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@ -945,7 +945,7 @@ $.ajaxPrefilter((options, originalOptions, xhr) => {
|
|||||||
export async function pingServer() {
|
export async function pingServer() {
|
||||||
try {
|
try {
|
||||||
const result = await fetch('api/ping', {
|
const result = await fetch('api/ping', {
|
||||||
method: 'GET',
|
method: 'POST',
|
||||||
headers: getRequestHeaders(),
|
headers: getRequestHeaders(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -903,7 +903,7 @@ async function slugify(text) {
|
|||||||
async function extendUserSession() {
|
async function extendUserSession() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/ping?extend=1', {
|
const response = await fetch('/api/ping?extend=1', {
|
||||||
method: 'GET',
|
method: 'POST',
|
||||||
headers: getRequestHeaders(),
|
headers: getRequestHeaders(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ app.use('/api/users', usersPublicRouter);
|
|||||||
|
|
||||||
// Everything below this line requires authentication
|
// Everything below this line requires authentication
|
||||||
app.use(requireLoginMiddleware);
|
app.use(requireLoginMiddleware);
|
||||||
app.get('/api/ping', (request, response) => {
|
app.use('/api/ping', (request, response) => {
|
||||||
if (request.query.extend && request.session) {
|
if (request.query.extend && request.session) {
|
||||||
request.session.touch = Date.now();
|
request.session.touch = Date.now();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user