mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2025-02-23 20:51:30 +03:00
Changes to Auth, proper credits
This commit is contained in:
parent
388feda287
commit
407d7faef2
3 changed files with 14 additions and 4 deletions
|
@ -26,6 +26,7 @@ module.exports.getAuth = function (username, password) {
|
|||
},
|
||||
username: username,
|
||||
password: password,
|
||||
clientToken: uuid(),
|
||||
requestUser: true
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +39,7 @@ module.exports.getAuth = function (username, password) {
|
|||
|
||||
const userProfile = {
|
||||
access_token: body.accessToken,
|
||||
client_token: uuid(),
|
||||
client_token: body.clientToken,
|
||||
uuid: body.selectedProfile.id,
|
||||
name: body.selectedProfile.name,
|
||||
selected_profile: body.selectedProfile,
|
||||
|
@ -50,12 +51,13 @@ module.exports.getAuth = function (username, password) {
|
|||
});
|
||||
};
|
||||
|
||||
module.exports.validate = function (access_token) {
|
||||
module.exports.validate = function (access_token, client_token) {
|
||||
return new Promise(resolve => {
|
||||
const requestObject = {
|
||||
url: api_url + "/validate",
|
||||
json: {
|
||||
"accessToken": access_token
|
||||
"accessToken": access_token,
|
||||
"clientToken": client_token
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue