mirror of
https://github.com/vx3r/wg-gen-web.git
synced 2024-12-18 00:13:23 +00:00
change auth header name, make auth basic work
This commit is contained in:
parent
6e08b2818d
commit
7e2146a229
@ -90,7 +90,7 @@ func main() {
|
|||||||
// cors middleware
|
// cors middleware
|
||||||
config := cors.DefaultConfig()
|
config := cors.DefaultConfig()
|
||||||
config.AllowAllOrigins = true
|
config.AllowAllOrigins = true
|
||||||
config.AddAllowHeaders("Authorization")
|
config.AddAllowHeaders("Authorization", util.AuthTokenHeaderName)
|
||||||
app.Use(cors.New(config))
|
app.Use(cors.New(config))
|
||||||
|
|
||||||
// protection middleware
|
// protection middleware
|
||||||
|
@ -4,7 +4,7 @@ import TokenService from "./token.service";
|
|||||||
const ApiService = {
|
const ApiService = {
|
||||||
|
|
||||||
setHeader() {
|
setHeader() {
|
||||||
Vue.axios.defaults.headers.common.Authorization = `${TokenService.getToken()}`;
|
Vue.axios.defaults.headers['x-wg-gen-web-auth'] = `${TokenService.getToken()}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
get(resource) {
|
get(resource) {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
AuthTokenHeaderName = "Authorization"
|
AuthTokenHeaderName = "x-wg-gen-web-auth"
|
||||||
// RegexpEmail check valid email
|
// RegexpEmail check valid email
|
||||||
RegexpEmail = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
RegexpEmail = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user