-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make signup and password reset token time customizable (#56)
* make signup and password reset token time customizable * add token time env var to readme
- Loading branch information
Showing
11 changed files
with
66 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
# If behind a reverse proxy, set this to your domain | ||
# i.e. https://wishlist.your-domain.org | ||
ORIGIN= | ||
|
||
ENABLE_SIGNUP=true | ||
|
||
ALLOW_SUGGESTIONS=true # turns this on or off | ||
# methods include | ||
# - suprise: automatically add suggested item and hide from the suggestee | ||
# - auto-approval: automatically add suggested item, but show to suggestee and allow removal by suggestee | ||
# - approval: require approval of suggested items by the suggestee | ||
SUGGESTION_METHOD="approval" | ||
|
||
# Set these to use email for sending reset password links | ||
# and invite codes | ||
SMTP_HOST= | ||
SMTP_PORT= | ||
SMTP_USER= | ||
SMTP_PASS= | ||
SMTP_FROM= | ||
SMTP_FROM_NAME= | ||
# Hours until signup and password reset tokens expire | ||
TOKEN_TIME=72 |
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
28 changes: 28 additions & 0 deletions
28
prisma/migrations/20231017150829_remove_expires_in/migration.sql
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,28 @@ | ||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_password_resets" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"userId" TEXT NOT NULL, | ||
"hashedToken" TEXT NOT NULL, | ||
"redeemed" BOOLEAN NOT NULL DEFAULT false | ||
); | ||
INSERT INTO "new_password_resets" ("createdAt", "hashedToken", "id", "redeemed", "userId") SELECT "createdAt", "hashedToken", "id", "redeemed", "userId" FROM "password_resets"; | ||
DROP TABLE "password_resets"; | ||
ALTER TABLE "new_password_resets" RENAME TO "password_resets"; | ||
CREATE UNIQUE INDEX "password_resets_id_key" ON "password_resets"("id"); | ||
CREATE INDEX "password_resets_hashedToken_idx" ON "password_resets"("hashedToken"); | ||
CREATE TABLE "new_signup_tokens" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"hashedToken" TEXT NOT NULL, | ||
"redeemed" BOOLEAN NOT NULL DEFAULT false, | ||
"groupId" TEXT NOT NULL DEFAULT 'global' | ||
); | ||
INSERT INTO "new_signup_tokens" ("createdAt", "groupId", "hashedToken", "id", "redeemed") SELECT "createdAt", "groupId", "hashedToken", "id", "redeemed" FROM "signup_tokens"; | ||
DROP TABLE "signup_tokens"; | ||
ALTER TABLE "new_signup_tokens" RENAME TO "signup_tokens"; | ||
CREATE UNIQUE INDEX "signup_tokens_id_key" ON "signup_tokens"("id"); | ||
CREATE INDEX "signup_tokens_hashedToken_idx" ON "signup_tokens"("hashedToken"); | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
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
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