mirror of
				https://github.com/bartvdbraak/omnidash.git
				synced 2025-10-30 16:09:11 +00:00 
			
		
		
		
	feat: change oauth button
This commit is contained in:
		
							parent
							
								
									2ea6df9fbe
								
							
						
					
					
						commit
						b4b2eb9055
					
				
					 3 changed files with 39 additions and 38 deletions
				
			
		|  | @ -26,7 +26,6 @@ export const actions: Actions = { | ||||||
| 	oauth2: async ({ request, locals }: { request: Request; locals: App.Locals }) => { | 	oauth2: async ({ request, locals }: { request: Request; locals: App.Locals }) => { | ||||||
| 		const body = Object.fromEntries(await request.formData()); | 		const body = Object.fromEntries(await request.formData()); | ||||||
| 		const provider = body.provider.toString(); | 		const provider = body.provider.toString(); | ||||||
| 		console.log('provider: ', provider); |  | ||||||
| 		await locals.pocketBase.collection('users').authWithOAuth2({ provider: provider }); | 		await locals.pocketBase.collection('users').authWithOAuth2({ provider: provider }); | ||||||
| 	} | 	} | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ | ||||||
| 	<div class="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]"> | 	<div class="mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]"> | ||||||
| 		<div class="flex flex-col space-y-2 text-center"> | 		<div class="flex flex-col space-y-2 text-center"> | ||||||
| 			<h1 class="text-2xl font-semibold tracking-tight">Log into your account</h1> | 			<h1 class="text-2xl font-semibold tracking-tight">Log into your account</h1> | ||||||
| 			<p class="text-sm text-muted-foreground"> | 			<p class="text-muted-foreground text-sm"> | ||||||
| 				Enter your email and password below to log into your account | 				Enter your email and password below to log into your account | ||||||
| 			</p> | 			</p> | ||||||
| 		</div> | 		</div> | ||||||
|  | @ -91,19 +91,19 @@ | ||||||
| 							<span class="w-full border-t" /> | 							<span class="w-full border-t" /> | ||||||
| 						</div> | 						</div> | ||||||
| 						<div class="relative flex justify-center text-xs uppercase"> | 						<div class="relative flex justify-center text-xs uppercase"> | ||||||
| 							<span class="bg-background px-2 py-6 text-muted-foreground"> Or continue with </span> | 							<span class="bg-background text-muted-foreground px-2 py-6"> Or continue with </span> | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
| 					<div | 					<div | ||||||
| 						class="flex items-center justify-between rounded-md bg-secondary text-secondary-foreground" | 						class="focus-visible:ring-ring border-input hover:bg-accent hover:text-accent-foreground flex items-center justify-between whitespace-nowrap rounded-md border bg-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50" | ||||||
| 					> | 					> | ||||||
| 						<input type="hidden" name="provider" bind:value={currentProvider.name} /> | 						<input type="hidden" name="provider" bind:value={currentProvider.name} /> | ||||||
| 						<div class="flex w-full items-center justify-center space-x-2"> | 						<div class="flex w-full items-center justify-center space-x-2"> | ||||||
| 							<Button | 							<Button | ||||||
| 								type="submit" | 								type="submit" | ||||||
| 								name={currentProvider.name} | 								name={currentProvider.name} | ||||||
| 								variant="secondary" | 								variant="ghost" | ||||||
| 								class="px-3" | 								class="w-full" | ||||||
| 								disabled={isLoading} | 								disabled={isLoading} | ||||||
| 							> | 							> | ||||||
| 								{#if isLoading} | 								{#if isLoading} | ||||||
|  | @ -122,14 +122,15 @@ | ||||||
| 						</div> | 						</div> | ||||||
| 						{#if providers.length > 1} | 						{#if providers.length > 1} | ||||||
| 							<div class="flex items-center space-x-2"> | 							<div class="flex items-center space-x-2"> | ||||||
| 								<Separator orientation="vertical" class="h-[20px] bg-gray-400 dark:bg-gray-500" /> | 								<Separator orientation="vertical" class="bg-secondary h-[20px]" /> | ||||||
|  | 								<div class="flex items-center space-x-2"> | ||||||
| 									<DropdownMenu.Root> | 									<DropdownMenu.Root> | ||||||
| 										<DropdownMenu.Trigger asChild let:builder> | 										<DropdownMenu.Trigger asChild let:builder> | ||||||
| 										<Button builders={[builder]} variant="secondary" class="px-2 shadow-none"> | 											<Button builders={[builder]} variant="ghost" class="px-2 shadow-none"> | ||||||
| 											<ChevronDown class="h-4 w-4 text-secondary-foreground" /> | 												<ChevronDown class="h-4 w-4" /> | ||||||
| 											</Button> | 											</Button> | ||||||
| 										</DropdownMenu.Trigger> | 										</DropdownMenu.Trigger> | ||||||
| 									<DropdownMenu.Content class="w-80" align="end"> | 										<DropdownMenu.Content class="" align="center"> | ||||||
| 											<DropdownMenu.Label class="sr-only">Login Providers</DropdownMenu.Label> | 											<DropdownMenu.Label class="sr-only">Login Providers</DropdownMenu.Label> | ||||||
| 											{#each providersWithIcons as provider} | 											{#each providersWithIcons as provider} | ||||||
| 												{#if provider.name !== currentProvider.name} | 												{#if provider.name !== currentProvider.name} | ||||||
|  | @ -153,12 +154,13 @@ | ||||||
| 										</DropdownMenu.Content> | 										</DropdownMenu.Content> | ||||||
| 									</DropdownMenu.Root> | 									</DropdownMenu.Root> | ||||||
| 								</div> | 								</div> | ||||||
|  | 							</div> | ||||||
| 						{/if} | 						{/if} | ||||||
| 					</div> | 					</div> | ||||||
| 				{/if} | 				{/if} | ||||||
| 			</form> | 			</form> | ||||||
| 		</div> | 		</div> | ||||||
| 		<p class="px-8 text-center text-sm text-muted-foreground"> | 		<p class="text-muted-foreground px-8 text-center text-sm"> | ||||||
| 			Don't have an account? <a class="text-primary underline" href="/register">Sign up.</a> <br /> | 			Don't have an account? <a class="text-primary underline" href="/register">Sign up.</a> <br /> | ||||||
| 			Forgot password? <a class="text-primary underline" href="/reset-password">Reset password.</a> | 			Forgot password? <a class="text-primary underline" href="/reset-password">Reset password.</a> | ||||||
| 		</p> | 		</p> | ||||||
|  |  | ||||||
|  | @ -76,7 +76,7 @@ | ||||||
| 					<span class="bg-background px-2 text-muted-foreground"> Or continue with </span> | 					<span class="bg-background px-2 text-muted-foreground"> Or continue with </span> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| 			<Button variant="outline" type="button" disabled={true}> | 			<Button variant="outline" type="button" disabled={isLoading}> | ||||||
| 				{#if isLoading} | 				{#if isLoading} | ||||||
| 					<Icons.spinner class="mr-2 h-4 w-4 animate-spin" /> | 					<Icons.spinner class="mr-2 h-4 w-4 animate-spin" /> | ||||||
| 				{:else} | 				{:else} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue