feat: design applications and first api calls

Co-authored-by: Walid <87608619+WalidKorchi@users.noreply.github.com>
This commit is contained in:
Divlo
2021-10-24 06:09:43 +02:00
parent 33bd2bb6bf
commit a0fa66e8f5
136 changed files with 14787 additions and 1668 deletions

29
utils/cookies.ts Normal file
View File

@ -0,0 +1,29 @@
import UniversalCookie from 'universal-cookie'
export class Cookies {
/** how long in seconds, until the cookie expires (10 years) */
static readonly COOKIE_MAX_AGE = 10 * 365.25 * 24 * 60 * 60
public universalCookie: UniversalCookie
constructor(cookies?: string | object | null) {
this.universalCookie = new UniversalCookie(cookies)
}
set(name: string, value: string): void {
this.universalCookie.set(name, value, {
path: '/',
maxAge: Cookies.COOKIE_MAX_AGE
})
}
remove(name: string): void {
this.universalCookie.remove(name, { path: '/' })
}
get(name: string): string {
return this.universalCookie.get(name)
}
}
export const cookies = new Cookies()