File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ import { auth } from '$lib/stores/auth';
99import { v4 as uuidv4 } from 'uuid' ;
1010
1111
12+ /**
13+ * @param {Object } params - OAuth parameters
14+ * @param {string } params.access_token - Access token
15+ */
1216async function fetchUserData ( params ) {
1317 const url = 'https://www.googleapis.com/oauth2/v1/userinfo'
1418
Original file line number Diff line number Diff line change 106106 <div class =" flex items-center p-3 bg-white/10 backdrop-blur-sm rounded-xl border border-white/20"
107107 in:fly =" {{ y : 30 , duration : 600 , delay : 600 + (i * 100 ) }}" >
108108 <div class =" rounded-lg bg-white/20 p-2 mr-3" >
109- {#snippet featureIcon (icon )}
109+ {#snippet featureIcon (/** @type {any} */ icon )}
110110 {@const FeatureIcon = icon }
111111 <FeatureIcon class =" w-5 h-5" />
112112 {/ snippet }
Original file line number Diff line number Diff line change 99 const { orgs } = data;
1010
1111 // Function to handle organization selection
12+ /**
13+ * @param {Object} org - Organization object
14+ * @param {string} org.id - Organization ID
15+ * @param {string} org.name - Organization name
16+ */
1217 function selectOrg (org ) {
1318 if (browser) {
1419 // Set both org id and org name in cookies
Original file line number Diff line number Diff line change @@ -23,7 +23,15 @@ export const actions = {
2323
2424 // Get the submitted form data
2525 const formData = await request . formData ( ) ;
26- const orgName = formData . get ( 'org_name' ) ;
26+ const orgName = formData . get ( 'org_name' ) ?. toString ( ) ;
27+
28+ if ( ! orgName ) {
29+ return {
30+ error : {
31+ name : 'Organization name is required'
32+ }
33+ } ;
34+ }
2735
2836 try {
2937 // Check if organization with the same name already exists
You can’t perform that action at this time.
0 commit comments