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
@Bean | |
@ConditionalOnBean(name = DEFAULT_FILTER_NAME) | |
public DelegatingFilterProxyRegistrationBean securityFilterChainRegistration( | |
SecurityProperties securityProperties) { | |
DelegatingFilterProxyRegistrationBean registration = new DelegatingFilterProxyRegistrationBean( | |
DEFAULT_FILTER_NAME); | |
registration.setOrder(securityProperties.getFilter().getOrder()); | |
registration.setDispatcherTypes(getDispatcherTypes(securityProperties)); | |
return registration; | |
} |
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
require('dotenv').config(); | |
const express = require("express"); | |
const path = require('path') | |
const app = express() | |
const hbs = require("hbs") | |
// auth related imports | |
const session = require('express-session'); | |
const mongoose = require('mongoose'); | |
const mongodbStore = require('connect-mongo')(session); |
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
const express = require("express") | |
const passport = require("../config/passport") | |
const validUrl = require("valid-url") | |
const Links = require("../models/Links"); | |
const User = require("../models/User"); | |
let router = express.Router() |
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
const passport = require("passport"); | |
const LocalStrategy = require('passport-local').Strategy; | |
const User = require("../models/User"); | |
// Passport JS serialize user | |
passport.serializeUser(function (user, done) { | |
done(null, user.email); | |
}); |
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
const mongoose = require('mongoose'); | |
let LinkSchema = new mongoose.Schema({ | |
link: { | |
type: String, | |
required: true, | |
trim: true | |
}, | |
name: { |
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
const mongoose = require('mongoose'); | |
const bcrypt = require('bcrypt-nodejs'); | |
var UserSchema = new mongoose.Schema({ | |
username: { | |
type: String, | |
required: true, | |
unique:false | |
}, |
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
// Change the input fiel to file name | |
$('#pageImage').on('change', function (e) { | |
let fileName = e.target.files[0].name; | |
$('.custom-file-label').html(fileName); | |
}) | |
async function makeRequest(url, config) { | |
try { | |
const response = await fetch(url, config); |
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
$(window).on('load',function(){ | |
$('#signupModal').modal('show'); | |
}); |
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
$(window).on('load', function () { | |
$('#loginModal').modal('show'); | |
}); |
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
html { | |
height: 100%; | |
} | |
body{ | |
background-color: #f5f0f0; | |
height: 100%; | |
} | |
.content-container{ |