-
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.
* [#187584914]added logout feature * [starts #187584914] added logout feature * [finishes#187584914] logout feature * [delivers##187584914] updated readme & swagger.json * [delivers##187584914] updated readme & swagger.json * [deliveres #187584914] logout features completed * [deliveres #187584914] logout features completed * [delivers #187584914] finished logout feature
- Loading branch information
1 parent
b0606a1
commit 2ce3982
Showing
20 changed files
with
832 additions
and
214 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
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,11 @@ | ||
Believe: Know that the problem you have identified has a solution, and trust that you and your team can build something to address it. | ||
|
||
Understand: Take the time to learn about the experience of the people affected by this problem / who will be using your solution – what does their journey look like? What are their pain points? What factors are affecting how they operate in / engage with the world? | ||
|
||
Invent: Create a Minimum Viable Product or prototype to test out an idea that you have! Be sure to keep in mind how your “invention” will meet your users’ needs. | ||
|
||
Listen: Get feedback from your users on your MVP / prototype and modify it as needed. | ||
|
||
Deliver: Continue to deliver refined versions of your MVP / prototype and improve it over time! | ||
|
||
Password@123 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,70 @@ | ||
/* eslint-disable require-jsdoc */ | ||
import { Model, DataTypes, Sequelize } from "sequelize"; | ||
|
||
interface TokenAttributes { | ||
id: number; | ||
userId: number; | ||
device: string; | ||
accessToken: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
expiresAt: Date; | ||
} | ||
|
||
module.exports = (sequelize: Sequelize) => { | ||
class Tokens extends Model<TokenAttributes> implements TokenAttributes { | ||
declare id: number; | ||
declare userId: number; | ||
declare device: string; | ||
declare accessToken: string; | ||
declare createdAt: Date; | ||
declare updatedAt: Date; | ||
declare expiresAt: Date; | ||
} | ||
|
||
Tokens.init( | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true | ||
}, | ||
userId: { | ||
type: new DataTypes.INTEGER(), | ||
allowNull: false | ||
}, | ||
device: { | ||
type: new DataTypes.STRING(280), | ||
allowNull: false | ||
}, | ||
accessToken: { | ||
type: new DataTypes.STRING(280), | ||
allowNull: false | ||
}, | ||
createdAt: { | ||
field: "createdAt", | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
defaultValue: DataTypes.NOW | ||
}, | ||
updatedAt: { | ||
field: "updatedAt", | ||
type: DataTypes.DATE, | ||
allowNull: false, | ||
defaultValue: DataTypes.NOW | ||
}, | ||
expiresAt: { | ||
type: DataTypes.DATE, | ||
allowNull: false | ||
} | ||
}, | ||
{ | ||
sequelize, | ||
tableName: "tokens", | ||
timestamps: true, | ||
modelName: "Tokens" | ||
} | ||
); | ||
|
||
return Tokens; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// import { Request } from "express"; | ||
// import multer from "multer"; | ||
// import path from "path"; | ||
import { Request } from "express"; | ||
import multer from "multer"; | ||
import path from "path"; | ||
|
||
// export default multer({ | ||
// storage:multer.diskStorage({}), | ||
// fileFilter:(req:Request,file:Express.Multer.File,cb)=>{ | ||
// const ext = path.extname(file.originalname); | ||
// if(ext!== ".png" && ext!== ".jpg" && ext!== ".jpeg"){ | ||
// return cb(new Error("Only images are allowed")); | ||
// } | ||
// cb(null,true); | ||
// } | ||
// }) | ||
export default multer({ | ||
storage:multer.diskStorage({}), | ||
fileFilter:(req:Request,file:Express.Multer.File,cb)=>{ | ||
const ext = path.extname(file.originalname); | ||
if(ext!== ".png" && ext!== ".jpg" && ext!== ".jpeg"){ | ||
return cb(new Error("Only images are allowed")); | ||
} | ||
cb(null,true); | ||
} | ||
}) |
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
// import { v2 as cloudinary } from "cloudinary"; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { v2 as cloudinary } from "cloudinary"; | ||
|
||
// cloudinary.config({ | ||
// cloud_name: process.env.CLOUD_NAME, | ||
// api_key: process.env.API_KEY, | ||
// api_secret: process.env.API_SECRET | ||
// }); | ||
cloudinary.config({ | ||
cloud_name: process.env.CLOUD_NAME, | ||
api_key: process.env.API_KEY, | ||
api_secret: process.env.API_SECRET | ||
}); | ||
|
||
// export const uploadImages = async (fileToUpload: any): Promise<{ public_id: string; secure_url: string }> => { | ||
// const result = await cloudinary.uploader.upload(fileToUpload.path); | ||
// return { | ||
// public_id: result.public_id, | ||
// secure_url: result.secure_url | ||
// }; | ||
// }; | ||
export const uploadImages = async (fileToUpload: any): Promise<{ public_id: string; secure_url: string }> => { | ||
const result = await cloudinary.uploader.upload(fileToUpload.path); | ||
return { | ||
public_id: result.public_id, | ||
secure_url: result.secure_url | ||
}; | ||
}; | ||
|
||
// export default uploadImages; | ||
export default uploadImages; |
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
Oops, something went wrong.