-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
128 additions
and
34 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,6 @@ | ||
<div class="container-fluid"> | ||
<h2 class="col-sm-offset-2" style="margin-bottom: 30px"> | ||
Forgot your password? | ||
</h2> | ||
<div sp-password-reset-request-form></div> | ||
</div> |
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,16 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('myApp') | ||
.config(stateConfig); | ||
|
||
stateConfig.$inject = ['$stateProvider']; | ||
|
||
function stateConfig($stateProvider) { | ||
$stateProvider | ||
.state('forgot', { | ||
url: '/forgot', | ||
templateUrl: 'forgot/forgot.html' | ||
}); | ||
} | ||
})(); |
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,4 @@ | ||
<h2 class="col-sm-offset-2" style="margin-bottom: 30px"> | ||
Login or <a href="" ui-sref="register">Create Account</a> | ||
</h2> | ||
<div sp-login-form></div> |
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,16 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('myApp') | ||
.config(stateConfig); | ||
|
||
stateConfig.$inject = ['$stateProvider']; | ||
|
||
function stateConfig($stateProvider) { | ||
$stateProvider | ||
.state('login', { | ||
url: '/login', | ||
templateUrl: 'login/login.html' | ||
}); | ||
} | ||
})(); |
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,6 @@ | ||
<div class="container-fluid"> | ||
<h2 class="col-sm-offset-2" style="margin-bottom: 30px"> | ||
Create Account | ||
</h2> | ||
<div sp-registration-form></div> | ||
</div> |
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,16 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('myApp') | ||
.config(stateConfig); | ||
|
||
stateConfig.$inject = ['$stateProvider']; | ||
|
||
function stateConfig($stateProvider) { | ||
$stateProvider | ||
.state('register', { | ||
url: '/register', | ||
templateUrl: 'register/register.html' | ||
}); | ||
} | ||
})(); |
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
This file was deleted.
Oops, something went wrong.
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,13 +1,44 @@ | ||
package com.example; | ||
|
||
import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.builders.WebSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
import org.springframework.web.cors.CorsConfiguration; | ||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; | ||
import org.springframework.web.filter.CorsFilter; | ||
|
||
import static com.stormpath.spring.config.StormpathWebSecurityConfigurer.stormpath; | ||
|
||
@Configuration | ||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
public void configure(WebSecurity web) throws Exception { | ||
web.debug(true); | ||
} | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http.authorizeRequests().antMatchers("/**").permitAll(); | ||
http.apply(stormpath()).and() | ||
.authorizeRequests() | ||
.antMatchers("/api/**").fullyAuthenticated() | ||
.antMatchers("/**").permitAll(); | ||
} | ||
|
||
@Bean | ||
public FilterRegistrationBean corsFilter() { | ||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); | ||
CorsConfiguration config = new CorsConfiguration(); | ||
config.setAllowCredentials(true); | ||
config.addAllowedOrigin("http://localhost:3000"); | ||
config.addAllowedHeader("*"); | ||
config.addAllowedMethod("*"); | ||
source.registerCorsConfiguration("/**", config); | ||
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); | ||
bean.setOrder(0); | ||
return bean; | ||
} | ||
} |
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 +1,3 @@ | ||
spring.data.rest.basePath=/api | ||
#stormpath.web.me.expand.customData=true | ||
stormpath.web.stormpathFilter.order=1 |