prettier
This commit is contained in:
parent
7116a9a1b0
commit
5a7765c7dc
@ -26,7 +26,7 @@ import {
|
|||||||
Sentry,
|
Sentry,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
ConnectionConfig,
|
ConnectionConfig,
|
||||||
ConnectionLoader
|
ConnectionLoader,
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { Server, ServerOptions } from "lambert-server";
|
import { Server, ServerOptions } from "lambert-server";
|
||||||
|
@ -53,7 +53,7 @@ export const NO_AUTHORIZATION_ROUTES = [
|
|||||||
// Asset delivery
|
// Asset delivery
|
||||||
/\/guilds\/\d+\/widget\.(json|png)/,
|
/\/guilds\/\d+\/widget\.(json|png)/,
|
||||||
// Connections
|
// Connections
|
||||||
/\/connections\/\w+\/callback/
|
/\/connections\/\w+\/callback/,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const API_PREFIX = /^\/api(\/v\d+)?/;
|
export const API_PREFIX = /^\/api(\/v\d+)?/;
|
||||||
|
@ -79,8 +79,15 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
this.user_id = decoded.id;
|
this.user_id = decoded.id;
|
||||||
const session_id = this.session_id;
|
const session_id = this.session_id;
|
||||||
|
|
||||||
const [user, read_states, members, recipients, session, application, connected_accounts] =
|
const [
|
||||||
await Promise.all([
|
user,
|
||||||
|
read_states,
|
||||||
|
members,
|
||||||
|
recipients,
|
||||||
|
session,
|
||||||
|
application,
|
||||||
|
connected_accounts,
|
||||||
|
] = await Promise.all([
|
||||||
User.findOneOrFail({
|
User.findOneOrFail({
|
||||||
where: { id: this.user_id },
|
where: { id: this.user_id },
|
||||||
relations: ["relationships", "relationships.to", "settings"],
|
relations: ["relationships", "relationships.to", "settings"],
|
||||||
@ -124,7 +131,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
activities: [],
|
activities: [],
|
||||||
}).save(),
|
}).save(),
|
||||||
Application.findOne({ where: { id: this.user_id } }),
|
Application.findOne({ where: { id: this.user_id } }),
|
||||||
ConnectedAccount.find({ where: { user_id: this.user_id } })
|
ConnectedAccount.find({ where: { user_id: this.user_id } }),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
||||||
|
@ -25,4 +25,4 @@ export * from "./dtos/index";
|
|||||||
export * from "./schemas";
|
export * from "./schemas";
|
||||||
export * from "./imports";
|
export * from "./imports";
|
||||||
export * from "./config";
|
export * from "./config";
|
||||||
export * from "./connections"
|
export * from "./connections";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user