1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 21:30:05 +00:00

test(web): moved authorize specs from api to web

This commit is contained in:
Saad Jutt
2022-05-12 17:59:12 +05:00
parent 5888f04e08
commit a0b52d9982
5 changed files with 192 additions and 120 deletions

View File

@@ -108,6 +108,10 @@ const authorize = async (
): Promise<AuthorizeResponse> => {
const userId = req.session.user?.userId
if (!userId) throw new Error('Invalid userId.')
const client = await Client.findOne({ clientId })
if (!client) throw new Error('Invalid clientId.')
// generate authorization code against clientId
const userInfo: InfoJWT = {
clientId,