-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified Ui Authentication #135
Conversation
…dified register. modified add to comply with changes to UIAuth. Modified/added tests for new Uiauth.
packages/matrix-client-server/src/utils/userInteractiveAuthentication.ts
Fixed
Show fixed
Hide fixed
.then((deviceRows) => { | ||
let initial_device_display_name | ||
if (deviceRows.length > 0) { | ||
// TODO : Refresh access tokens using refresh tokens and invalidate the previous access_token associated with the device after implementing the /refresh endpoint |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
packages/matrix-client-server/src/utils/userInteractiveAuthentication.ts
Fixed
Show fixed
Hide fixed
@@ -1,6 +1,7 @@ | |||
import { type expressAppHandler, send } from '@twake/utils' | |||
import type MatrixClientServer from '..' | |||
|
|||
// TODO : Modify default value of sso login in config |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
…andling of inhibit_login
…d test coverage of capability endpoint
…ewly added m.room_versions capabilities
…dified register. modified add to comply with changes to UIAuth. Modified/added tests for new Uiauth.
send(res, 200, { | ||
access_token: accessToken, | ||
device_id: deviceId, | ||
user_id: userId, | ||
expires_in_ms: 60000 // Arbitrary value, should probably be defined in the server config | ||
expires_in_ms: 60000 // Arbitrary value, should probably be defined in the server config // TODO : Add this in the config |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
access_token: accessToken, | ||
device_id: deviceId, | ||
user_id: userId, | ||
expires_in_ms: 60000, // Arbitrary value, should probably be defined in the server config // TODO : Add this in the config |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
id: refreshTokenId, | ||
user_id: userId, | ||
device_id: deviceId, | ||
token: refreshToken // TODO : maybe add expiry_ts here |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
device_id: deviceId, | ||
valid_until_ms: 0, | ||
refresh_token_id: refreshTokenId | ||
}) // TODO : Add a token_lifetime in the config, replace the id with a correct one, and fill the 'puppets_user_id' row with the right value |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
'users', | ||
{ | ||
...commonUserData, | ||
password_hash: hash.sha256(password) // TODO: Handle other hashing algorithms |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
creation_time: epoch(), | ||
clientdict: JSON.stringify(obj), | ||
serverdict: JSON.stringify({}), | ||
uri: req.url as string, // TODO : Ensure this is the right way to get the URI |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
packages/matrix-client-server/src/utils/userInteractiveAuthentication.ts
Dismissed
Show dismissed
Hide dismissed
@BichraiX : merge it when test succeeds |
|
Modified UI Authentication to fill the right tables in the matrix database and have better error handling. Updated the endpoints that use Ui Auth (/add and /register) in order to comply with these changes.
Added a README file for UI authentication to clarify usage.