-
Couldn't load subscription status.
- Fork 11
feat: session issues #1087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: session issues #1087
Changes from all commits
2d42d0e
95c2e32
6b3d5b4
e458949
feb6f71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,9 @@ | |
| import { ExclamationTriangleIcon } from '@heroicons/vue/24/solid'; | ||
| import { BrandButton, BrandLogo } from '@unraid/ui'; | ||
| import { serverState } from '~/_data/serverState'; | ||
| import SsoButtonCe from '~/components/SsoButton.ce.vue'; | ||
| import type { SendPayloads } from '~/store/callback'; | ||
| import AES from 'crypto-js/aes'; | ||
| import SsoButtonCe from '~/components/SsoButton.ce.vue'; | ||
|
|
||
| const { registerEntry } = useCustomElements(); | ||
| onBeforeMount(() => { | ||
|
|
@@ -15,6 +15,10 @@ useHead({ | |
| meta: [{ name: 'viewport', content: 'width=1300' }], | ||
| }); | ||
|
|
||
| onMounted(() => { | ||
| document.cookie = 'unraid_session_cookie=mockusersession'; | ||
| }); | ||
|
Comment on lines
+18
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blimey! This cookie be vulnerable to pirates! Arr matey, setting cookies directly in the frontend code be askin' for trouble! Any scurvy dog with a browser console could manipulate this session. Consider these security measures to protect yer treasure:
Here's a safer way to handle sessions, ye landlubber: -onMounted(() => {
- document.cookie = 'unraid_session_cookie=mockusersession';
-});Move this to your backend authentication route instead! |
||
|
|
||
| const valueToMakeCallback = ref<SendPayloads | undefined>(); | ||
| const callbackDestination = ref<string>(''); | ||
|
|
||
|
|
@@ -156,7 +160,7 @@ onMounted(() => { | |
| <div class="bg-background"> | ||
| <hr class="border-black dark:border-white" /> | ||
| <h2 class="text-xl font-semibold font-mono">SSO Button Component</h2> | ||
| <SsoButtonCe :ssoenabled="serverState.ssoEnabled" /> | ||
| <SsoButtonCe :ssoenabled="serverState.ssoEnabled" /> | ||
| </div> | ||
| </div> | ||
| </client-only> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Arrr! We be missin' some important test cases here, matey!
The test suite be lackin' coverage for the new
memoryandoverwriteparameters in thecreateApiKeymutation.Add these test cases to yer test suite:
describe('createApiKey', () => { + it('should create new API key in memory when memory flag is true', async () => { + const input = { + name: 'Memory API Key', + roles: [Role.GUEST], + memory: true + }; + // Add test implementation + }); + + it('should overwrite existing API key when overwrite flag is true', async () => { + const input = { + name: 'Existing Key', + roles: [Role.GUEST], + overwrite: true + }; + // Add test implementation + }); });