You've already forked AstralRinth
forked from didirus/AstralRinth
Affiliates frontend (#4380)
* Begin affiliates frontend * Significant work on hooking up affiliates ui * Clean up server nodes menu * affiliates work * update affiliate time * oops * fix local import * fix local import x2 * remove line in dashboard * lint
This commit is contained in:
22
apps/frontend/src/composables/affiliates.ts
Normal file
22
apps/frontend/src/composables/affiliates.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export const useAffiliates = () => {
|
||||
const affiliateCookie = useCookie('mrs_afl', {
|
||||
maxAge: 60 * 60 * 24 * 7, // 7 days
|
||||
sameSite: 'lax',
|
||||
secure: true,
|
||||
httpOnly: false,
|
||||
path: '/',
|
||||
})
|
||||
|
||||
const setAffiliateCode = (code: string) => {
|
||||
affiliateCookie.value = code
|
||||
}
|
||||
|
||||
const getAffiliateCode = (): string | undefined => {
|
||||
return affiliateCookie.value || undefined
|
||||
}
|
||||
|
||||
return {
|
||||
setAffiliateCode,
|
||||
getAffiliateCode,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user