From 8393ba727b8908bc859491864390e2ac7e7ef393 Mon Sep 17 00:00:00 2001 From: Justin Yek Date: Sun, 10 Aug 2014 22:48:11 +0800 Subject: [PATCH] Update authentication endpoint for subdirectory Fixes bug where user is unable to log into admin when subdirectory is specified --- core/client/initializers/authentication.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/client/initializers/authentication.js b/core/client/initializers/authentication.js index aa604a21dd..5f9aa7f3c8 100644 --- a/core/client/initializers/authentication.js +++ b/core/client/initializers/authentication.js @@ -1,3 +1,7 @@ +import ghostPaths from 'ghost/utils/ghost-paths'; + +var Ghost = ghostPaths(); + var AuthenticationInitializer = { name: 'authentication', @@ -17,7 +21,7 @@ var AuthenticationInitializer = { }.property() }); SimpleAuth.Authenticators.OAuth2.reopen({ - serverTokenEndpoint: '/ghost/api/v0.1/authentication/token', + serverTokenEndpoint: Ghost.apiRoot + '/authentication/token', refreshAccessTokens: true, makeRequest: function (url, data) { data.client_id = 'ghost-admin';