Skip to content

Instantly share code, notes, and snippets.

View saman-ghm's full-sized avatar
☺️
Relaxed!

Saman Gholami saman-ghm

☺️
Relaxed!
View GitHub Profile
import { Request, Response } from "express";
class UserController {
static check = async(req:Request,res:Response) => {
res.send("You're authorized!");
}
}
export default UserController;
import { Request, Response } from "express";
import * as jwt from "jsonwebtoken";
import { random } from "../utils/index";
import config from "../config/index";
class AuthController {
public static refTokens = new Array<{ username: string, refreshToken: string }>();
private static issueToken = async (username: string) => {
const userToken = {
username
@saman-ghm
saman-ghm / server.ts
Created October 11, 2019 19:23
Refresh token using Node
import express from "express";
const app = express();
app.get('/', (req, res) => {
res.send("Hello world!");
});
app.listen(3000, () => {
console.log(`Server is running in http://localhost:3000`);
public class Student
{
public string Name {get; set;}
}