mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
fix: add public profiles tests
This commit is contained in:
@ -30,10 +30,10 @@ const getAuthSecret = () => {
|
||||
export const sessionCookieOptions = {
|
||||
httpOnly: true,
|
||||
path: '/',
|
||||
sameSite: useSecureCookies ? 'none' : 'lax', // Todo: This feels wrong?
|
||||
sameSite: useSecureCookies ? 'none' : 'lax', // Todo: (RR7) This feels wrong?
|
||||
secure: useSecureCookies,
|
||||
domain: getCookieDomain(),
|
||||
// Todo: Max age for specific auth cookies.
|
||||
// Todo: (RR7) Max age for specific auth cookies.
|
||||
} as const;
|
||||
|
||||
export const extractSessionCookieFromHeaders = (headers: Headers): string | null => {
|
||||
|
||||
@ -38,7 +38,7 @@ export const getOptionalSession = async (
|
||||
};
|
||||
|
||||
/**
|
||||
* Todo: Rethink, this is pretty sketchy.
|
||||
* Todo: (RR7) Rethink, this is pretty sketchy.
|
||||
*/
|
||||
const mapRequestToContextForCookie = (c: Context | Request) => {
|
||||
if (c instanceof Request) {
|
||||
|
||||
@ -144,7 +144,7 @@ export const handleOAuthCallbackUrl = async (options: HandleOAuthCallbackUrlOpti
|
||||
},
|
||||
data: {
|
||||
emailVerified: new Date(),
|
||||
password: null, // Todo: Check this
|
||||
password: null, // Todo: (RR7) Check this
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -182,7 +182,7 @@ export const handleOAuthCallbackUrl = async (options: HandleOAuthCallbackUrlOpti
|
||||
});
|
||||
|
||||
await onCreateUserHook(createdUser).catch((err) => {
|
||||
// Todo: Add logging.
|
||||
// Todo: (RR7) Add logging.
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ export const emailPasswordRoute = new Hono<HonoAuthContext>()
|
||||
|
||||
const csrfCookieToken = await getCsrfCookie(c);
|
||||
|
||||
// Todo: Add logging here.
|
||||
// Todo: (RR7) Add logging here.
|
||||
if (csrfToken !== csrfCookieToken || !csrfCookieToken) {
|
||||
throw new AppError(AuthenticationErrorCode.InvalidRequest, {
|
||||
message: 'Invalid CSRF token',
|
||||
|
||||
Reference in New Issue
Block a user