-
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41c3baf
commit 84d29df
Showing
17 changed files
with
340 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import { ExecutionContext } from "@nestjs/common"; | ||
import { AuthGuard } from "@nestjs/passport"; | ||
import { Observable } from "rxjs"; | ||
|
||
export class JwtGuard extends AuthGuard("jwt") { | ||
constructor() { | ||
super(); | ||
} | ||
canActivate( | ||
context: ExecutionContext | ||
): boolean | Promise<boolean> | Observable<boolean> { | ||
return process.env.ALLOW_UNAUTHENTICATED_SHARES == "true" ? true : super.canActivate(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SHOW_HOME_PAGE=true | ||
ALLOW_REGISTRATION=true | ||
MAX_FILE_SIZE=1000000000 | ||
ALLOW_UNAUTHENTICATED_SHARES=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
219 changes: 0 additions & 219 deletions
219
frontend/src/components/share/CreateUploadModalBody.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import moment from "moment"; | ||
|
||
const ExpirationPreview = ({ form }: { form: any }) => { | ||
const value = form.values.never_expires | ||
? "never" | ||
: form.values.expiration_num + form.values.expiration_unit; | ||
if (value === "never") return "This share will never expire."; | ||
|
||
const expirationDate = moment() | ||
.add( | ||
value.split("-")[0], | ||
value.split("-")[1] as moment.unitOfTime.DurationConstructor | ||
) | ||
.toDate(); | ||
|
||
return `This share will expire on ${moment(expirationDate).format("LLL")}`; | ||
}; | ||
|
||
export default ExpirationPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.