-
Notifications
You must be signed in to change notification settings - Fork 0
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
DanilSord
committed
Mar 11, 2022
1 parent
3278fc5
commit 70d9ead
Showing
1 changed file
with
119 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,119 @@ | ||
const { Auth } = require('./auth'); | ||
|
||
module.exports = { | ||
schema: { | ||
register: { | ||
public: true, | ||
description: 'Регистрация', | ||
params: { | ||
required: ['username', 'password'], | ||
properties: { | ||
username: { | ||
type: 'string', | ||
description: 'Имя пользователя' | ||
}, | ||
password: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
result: { | ||
required: ['username', 'role', 'createdTime'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
role: { | ||
type: 'string' | ||
}, | ||
createdTime: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
transport: 'http' | ||
}, | ||
login: { | ||
public: true, | ||
params: { | ||
required: ['username', 'password'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
password: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
result: { | ||
required: ['username', 'role', 'createdTime'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
role: { | ||
type: 'string' | ||
}, | ||
createdTime: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
transport: 'http' | ||
}, | ||
logout: { | ||
public: false, | ||
transport: 'http' | ||
}, | ||
me: { | ||
public: false, | ||
result: { | ||
required: ['username', 'role', 'createdTime'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
role: { | ||
type: 'string' | ||
}, | ||
createdTime: { | ||
type: 'string' | ||
} | ||
} | ||
} | ||
}, | ||
changePassword: { | ||
public: false, | ||
params: { | ||
required: ['username', 'oldPassword', 'newPassword'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
oldPassword: { | ||
type: 'string' | ||
}, | ||
newPassword: { | ||
type: 'string' | ||
} | ||
} | ||
}, | ||
result: { | ||
required: ['username', 'role', 'createdTime'], | ||
properties: { | ||
username: { | ||
type: 'string' | ||
}, | ||
role: { | ||
type: 'string' | ||
}, | ||
createdTime: { | ||
type: 'string' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
Module: Auth | ||
}; |