This file contains hidden or 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
var parallel = require('async').parallel; | |
var MongoClient = require('[email protected]').MongoClient; | |
module.exports = function (ctx, done) { | |
var url = 'mongodb://bkrebs:[email protected]:23410/brunokrebsauth0' | |
MongoClient.connect(url, function (err, db) { | |
if(err) return done(err); | |
db.collection('test').insertOne({ | |
name: 'Bruno [email protected]', |
This file contains hidden or 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
package com.auth0.samples.authapi.security; | |
// imports ... | |
public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { | |
private AuthenticationManager authenticationManager; | |
public JWTAuthenticationFilter(AuthenticationManager authenticationManager) { | |
this.authenticationManager = authenticationManager; | |
setFilterProcessesUrl("/api/login"); |
This file contains hidden or 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
package com.auth0.samples.authapi.security; | |
// ... imports | |
public class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { | |
// ... | |
@Override | |
protected void successfulAuthentication(HttpServletRequest req, | |
HttpServletResponse res, |
This file contains hidden or 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
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
alias git_poc="git push origin HEAD" | |
alias git_wip="git add . && git commit -m 'wip'" | |
alias git_cap="(cd ~/git/blog && git_wip && git_poc )" | |
alias refresh_hosts="sudo killall -HUP mDNSResponder" | |
alias refresh_bash="source ~/.bash_profile" | |
alias ll="ls -la" | |
alias blog="bundle exec jekyll serve --watch --limit_posts 10 &" |
This file contains hidden or 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
alias new_post="create_new_post" | |
function create_new_post { | |
# are we are on blog's root dir? | |
ls | grep Rakefile &> /dev/null \ | |
&& ls | grep _posts &> /dev/null | |
if [ $? -gt 0 ]; then | |
echo "not on blog's root directory" | |
return 1 | |
fi |
This file contains hidden or 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
# adds new repo as a remote | |
git remote add origin [email protected]:YOUR-USERNAME/YOUR-REPO.git | |
# commits our code | |
git add . | |
git commit -m "Task List Angular app with a secure serverless REST API." | |
# push work to new repo | |
git push origin master |
This file contains hidden or 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
// ... other imports | |
import { EventEmitter, Output } from '@angular/core'; | |
// ... component definition | |
export class TaskListComponent implements OnInit { | |
@Output() | |
startAjaxRequest = new EventEmitter<void>(); | |
@Output() |
This file contains hidden or 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
<app-nav-bar></app-nav-bar> | |
<div class="app-container"> | |
<!-- ... welcome message ... --> | |
<app-task-list *ngIf="authService.authenticated()" | |
(startAjaxRequest)="slimLoading.start()" | |
(completeAjaxRequest)="slimLoading.complete()"> | |
</app-task-list> | |
</div> |
This file contains hidden or 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
// ... other imports | |
import { SlimLoadingBarService } from 'ng2-slim-loading-bar'; | |
// ... component definition | |
export class AppComponent { | |
constructor(private authService: AuthService, private slimLoading: SlimLoadingBarService) { } | |
// ... method definitions | |
} |