-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3831 from BlackDex/fix-3819
Fix Login With Device without MasterPassword
- Loading branch information
Showing
11 changed files
with
53 additions
and
12 deletions.
There are no files selected for viewing
Empty file.
5 changes: 5 additions & 0 deletions
5
migrations/mysql/2023-09-01-170620_update_auth_request_table/up.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,5 @@ | ||
ALTER TABLE auth_requests | ||
MODIFY master_password_hash TEXT; | ||
|
||
ALTER TABLE auth_requests | ||
MODIFY enc_key TEXT; |
Empty file.
5 changes: 5 additions & 0 deletions
5
migrations/postgresql/2023-09-01-170620_update_auth_request_table/up.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,5 @@ | ||
ALTER TABLE auth_requests | ||
ALTER COLUMN master_password_hash DROP NOT NULL; | ||
|
||
ALTER TABLE auth_requests | ||
ALTER COLUMN enc_key DROP NOT NULL; |
Empty file.
29 changes: 29 additions & 0 deletions
29
migrations/sqlite/2023-09-01-170620_update_auth_request_table/up.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,29 @@ | ||
-- Create new auth_requests table with master_password_hash as nullable column | ||
CREATE TABLE auth_requests_new ( | ||
uuid TEXT NOT NULL PRIMARY KEY, | ||
user_uuid TEXT NOT NULL, | ||
organization_uuid TEXT, | ||
request_device_identifier TEXT NOT NULL, | ||
device_type INTEGER NOT NULL, | ||
request_ip TEXT NOT NULL, | ||
response_device_id TEXT, | ||
access_code TEXT NOT NULL, | ||
public_key TEXT NOT NULL, | ||
enc_key TEXT, | ||
master_password_hash TEXT, | ||
approved BOOLEAN, | ||
creation_date DATETIME NOT NULL, | ||
response_date DATETIME, | ||
authentication_date DATETIME, | ||
FOREIGN KEY (user_uuid) REFERENCES users (uuid), | ||
FOREIGN KEY (organization_uuid) REFERENCES organizations (uuid) | ||
); | ||
|
||
-- Transfer current data to new table | ||
INSERT INTO auth_requests_new SELECT * FROM auth_requests; | ||
|
||
-- Drop the old table | ||
DROP TABLE auth_requests; | ||
|
||
-- Rename the new table to the original name | ||
ALTER TABLE auth_requests_new RENAME TO auth_requests; |
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