|
1 | 1 | import { logger, field } from "@coder/logger"
|
2 | | -import { Cookie } from "../../test/helpers" |
3 | 2 |
|
4 | 3 | export interface Options {
|
5 | 4 | base: string
|
@@ -121,24 +120,3 @@ export function logError(prefix: string, err: any): void {
|
121 | 120 | logger.error(`${prefix}: ${err}`)
|
122 | 121 | }
|
123 | 122 | }
|
124 | | - |
125 | | -/** |
126 | | - * Checks if a cookie exists in array of cookies |
127 | | - */ |
128 | | -export function checkForCookie(cookies: Array<Cookie>, key: string): boolean { |
129 | | - // Check for a cookie where the name is equal to key |
130 | | - return Boolean(cookies.find((cookie) => cookie.name === key)) |
131 | | -} |
132 | | - |
133 | | -/** |
134 | | - * Creates a login cookie if one doesn't already exist |
135 | | - */ |
136 | | -export function createCookieIfDoesntExist(cookies: Array<Cookie>, cookieToStore: Cookie): Array<Cookie> { |
137 | | - const cookieName = cookieToStore.name |
138 | | - const doesCookieExist = checkForCookie(cookies, cookieName) |
139 | | - if (!doesCookieExist) { |
140 | | - const updatedCookies = [...cookies, cookieToStore] |
141 | | - return updatedCookies |
142 | | - } |
143 | | - return cookies |
144 | | -} |
0 commit comments