-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat[frontend]: added cookie handler for branding setting and refac…
…tored authentication cookie for better naming convention - Changed name of `cookieSetter` and `cookieDestroy` by adding auth prefix before the names. - Made a preliminary cookie handler to take care of branding settings of the application ✨ Refactor branding cookie functions Update function names to better reflect the purpose of setting and getting the branding color cookie. Ensure consistency and clarity in the codebase. ✨ Update authCookieSetter in GoogleSignIn and GitHubSignIn components - Update cookieSetter to authCookieSetter for setting authentication cookies in GoogleSignIn and GitHubSignIn components. This change ensures consistency in naming conventions and improves readability.
- Loading branch information
1 parent
af34f55
commit 5ed4f1d
Showing
9 changed files
with
50 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './cookie-destroy' | ||
export * from './cookie-setter' | ||
export * from './auth-cookie' | ||
export * from './theme-cookie' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use server"; | ||
|
||
import { cookies } from "next/headers"; | ||
import { redirect } from "next/navigation"; | ||
|
||
const apiCall = async () : Promise<string> => { | ||
// TODO: Call API to find the branding setting | ||
return "" | ||
} | ||
export async function setBrandingCookie() { | ||
const color : string = await apiCall() | ||
cookies().set("BrandingColor", color); | ||
} | ||
|
||
export async function getBrandingCookie() { | ||
return cookies().get("BrandingColor") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters