mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Syntax fixes (#5367)
* Declare return types on functions And a very few other type related minor fixes * Minor syntax fixes * Remove unnecessary escape chars in regexes * Remove unnecessary awaits * Replace deprecated req.connection with req.socket * Replace deprecated upload with uploadOne * Remove unnecessary eslint-disable-next-line comments * Comment empty functions / catch or finally clauses * Fix irregular whitespaces * Add missing returns (null) * Remove unreachable code * A few logical fixes * Remove / Handle non-null assertions which are certainly unnecessary (e.g. in tests)
This commit is contained in:
@@ -9,7 +9,7 @@ export type LoginCredentials = {
|
||||
password: string;
|
||||
};
|
||||
|
||||
export async function login(credentials: LoginCredentials) {
|
||||
export async function login(credentials: LoginCredentials): Promise<void> {
|
||||
const appStore = useAppStore();
|
||||
|
||||
const response = await api.post(`/auth/login`, {
|
||||
@@ -38,7 +38,7 @@ export async function login(credentials: LoginCredentials) {
|
||||
|
||||
let refreshTimeout: any;
|
||||
|
||||
export async function refresh({ navigate }: LogoutOptions = { navigate: true }) {
|
||||
export async function refresh({ navigate }: LogoutOptions = { navigate: true }): Promise<string | undefined> {
|
||||
const appStore = useAppStore();
|
||||
|
||||
try {
|
||||
@@ -79,7 +79,7 @@ export type LogoutOptions = {
|
||||
/**
|
||||
* Everything that should happen when someone logs out, or is logged out through an external factor
|
||||
*/
|
||||
export async function logout(optionsRaw: LogoutOptions = {}) {
|
||||
export async function logout(optionsRaw: LogoutOptions = {}): Promise<void> {
|
||||
const appStore = useAppStore();
|
||||
|
||||
const defaultOptions: Required<LogoutOptions> = {
|
||||
|
||||
Reference in New Issue
Block a user