Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Octo8080X committed Jan 12, 2024
1 parent 8475bec commit ab1106a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Fresh Garden 🍋
# Fresh Garden 🍋

Authentication plugin for Fresh(Deno) using Lucia.

Fresh Garden is inspired by [devise](https://github.com/heartcombo/devise).
Combining garden with fresh provides the ability to create accounts, log in
and log out.
Fresh Garden is inspired by [devise](https://github.com/heartcombo/devise).
Combining garden with fresh provides the ability to create accounts, log in and
log out.

[![Made with Fresh](https://fresh.deno.dev/fresh-badge-dark.svg)](https://fresh.deno.dev)

Expand Down Expand Up @@ -113,7 +113,7 @@ Please add "(async () => await import('./garden/extra_loader.ts'));" to your mai
```

When using the user resource, set `resourceName: "user"`.\
At this time, if garden/user/create.tsx(login.tsx, logout.tsx) is available,
it is referenced first.
At this time, if garden/user/create.tsx(login.tsx, logout.tsx) is available, it
is referenced first.

Use this for your own customization of CSS or for more detailed customization.
2 changes: 1 addition & 1 deletion routesTemplate/create.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
FreshContext,
GardenInnerParams,
LuciaError,
PageProps,
pascalCase,
PASSWORD,
GardenInnerParams,
sameLogicValidate,
styles,
WithCsrf,
Expand Down
5 changes: 2 additions & 3 deletions routesTemplate/login.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import {
FreshContext,
GardenInnerParams,
Handlers,
LuciaError,
PageProps,
pascalCase,
PASSWORD,
GardenInnerParams,
stringValidate,
styles,
WithCsrf,
} from "https://deno.land/x/garden/templateDeps.ts";

export function getLoginHandler(
{ auth, loginAfterPath, resourceIdentifierName, paths }:
GardenInnerParams,
{ auth, loginAfterPath, resourceIdentifierName, paths }: GardenInnerParams,
): Handlers<unknown, WithCsrf> {
return {
async POST(req: Request, ctx: FreshContext<WithCsrf>) {
Expand Down
2 changes: 1 addition & 1 deletion routesTemplate/logout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
FreshContext,
Handlers,
GardenInnerParams,
Handlers,
WithCsrf,
} from "https://deno.land/x/garden/templateDeps.ts";

Expand Down
3 changes: 1 addition & 2 deletions src/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { GardenInnerParams } from "../../types.ts";
import { PASSWORD } from "../utils/const.ts";

export function getLoginHandler(
{ auth, loginAfterPath, resourceIdentifierName, paths }:
GardenInnerParams,
{ auth, loginAfterPath, resourceIdentifierName, paths }: GardenInnerParams,
): Handlers<unknown, WithCsrf> {
return {
async POST(req: Request, ctx: FreshContext<WithCsrf>) {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { getPathMatchByPathsAndRegExps } from "./pathMatch.ts";
export function getInnerParams(
gardenParams: GardenParams,
): GardenInnerParams {
const { resourceName, allowNoSessionPaths, ...innerParams } =
gardenParams;
const { resourceName, allowNoSessionPaths, ...innerParams } = gardenParams;
const createPath = `/${resourceName}/create`;
const loginPath = `/${resourceName}/login`;
const logoutPath = `/${resourceName}/logout`;
Expand Down
3 changes: 1 addition & 2 deletions types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export interface DefaultActions {
type IdName<T extends string> = `${T}Id`;
type LuciaObjectKey<T extends string> = `auth${Capitalize<T>}Session`;

export interface WithGarden<Q extends string>
extends Record<string, unknown> {
export interface WithGarden<Q extends string> extends Record<string, unknown> {
garden: {
[K in LuciaObjectKey<Q>]:
& {
Expand Down

0 comments on commit ab1106a

Please sign in to comment.